harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r938121 - in /harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools: build.xml make/run-test.xml
Date Mon, 26 Apr 2010 16:49:50 GMT
Author: hindessm
Date: Mon Apr 26 16:49:50 2010
New Revision: 938121

URL: http://svn.apache.org/viewvc?rev=938121&view=rev
Log:
Move jdktools tests to hdk.

Added:
    harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/make/run-test.xml   (with
props)
Modified:
    harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/build.xml

Modified: harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/build.xml?rev=938121&r1=938120&r2=938121&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/build.xml (original)
+++ harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/build.xml Mon Apr 26 16:49:50
2010
@@ -28,10 +28,7 @@
     <property file="../../make/depends.properties" />
     <property file="${common.resources}/make/depends.properties" />
 
-    <!-- filename for tests exclude list -->
-    <property name="tools.exclude.file"
-              location="${hy.hdk}/build/jdktools.exclude" />
-   
+  
     <target name="check-depends">
         <check-one-file src="${jdt.jdi.jar.url}"
                         dest="${jdt.jdi.jar}" />
@@ -56,9 +53,10 @@
                            src="${bcel.url}" md5="${bcel.md5}"/>
     </target>
 
-    <target name="build" depends="check-depends,build-jar,copy-jars" />
+    <target name="build"
+            depends="check-depends,-build-jar,-copy-jars,-test-jar" />
 
-    <target name="test" depends="test-module">
+    <target name="test" depends="-test-module">
         <fail message="Some tests failed">
             <condition>
                 <or>
@@ -70,18 +68,23 @@
     </target>
 
     <!-- internal target for local and global test run sequence -->
-    <target name="test-module"
-            depends="build-tests,prepare-exclude,run-tests"/>
+    <target name="-test-module" depends="build,-run-tests" />
 
-    <target name="clean">
-        <echo message="Cleaning ${hy.module} classes" />
+    <target name="clean" depends="-clean-java,-clean-test" />
 
+    <target name="-clean-java" unless="skip.java.build">
+        <echo message="Cleaning ${hy.module} classes" />
         <delete file="${hy.jdk}/lib/tools.jar" />
         <delete file="${hy.jdk}/lib/tools-src.jar" />
-        <delete dir="bin" includeemptydirs="true" failonerror="false" />
+        <delete dir="bin/main" includeemptydirs="true" failonerror="false" />
     </target>
 
-    <target name="compile-java">
+    <target name="-clean-test" unless="skip.test.build">
+        <delete dir="${tests.hdk.dir}" failonerror="false" />
+        <delete failonerror="false" dir="bin/test"/>
+    </target>
+
+    <target name="-compile-java" unless="skip.java.build">
         <echo message="Compiling ${hy.module} classes" />
         <ensure-javac/>
         <mkdir dir="bin/main" />
@@ -90,8 +93,10 @@
                   srcdir="src/main/java"
                   destdir="bin/main">
 
+            <compilerarg line="${build.compilerarg}" />
+
             <bootclasspath>
-                <fileset dir="${hy.hdk}/jdk/jre/lib/boot">
+                <fileset dir="${hy.jdk}/jre/lib/boot">
                     <include name="**/*.jar" />
                 </fileset>
                 <fileset dir="${hy.hdk}/lib">
@@ -109,7 +114,15 @@
         </hy.javac>
     </target>
 
-    <target name="build-jar" depends="svn-info,compile-java">
+    <target name="findbugs" depends="-build-jar">
+        <run-findBugs
+            jarFile="${hy.jdk}/lib/tools.jar"
+            excludeFilter="make/findbugs-exclude-filter.xml"
+            outputFile="${findBugs.report}/${hy.module}.xml"/>
+    </target>
+
+    <target name="-build-jar" unless="skip.java.build"
+            depends="svn-info,-compile-java">
         <mkdir dir="${hy.jdk}/lib" />
 
         <hy.jar.bin destfile="${hy.jdk}/lib/tools.jar"
@@ -131,101 +144,52 @@
         </hy.jar.src>
     </target>
 
-    <target name="copy-jars">
+    <target name="-copy-jars" unless="skip.java.build">
         <mkdir dir="${hy.jdk}/lib" />
         <copy todir="${hy.jdk}/lib" flatten="true">
             <fileset file="${ecj.jar}"/>
         </copy>
     </target>
 
-    <target name="build-tests">
-        <echo message="Compiling ${hy.module} tests" />
-        <ensure-javac/>
-        <mkdir dir="bin/test" />
-
-        <hy.javac srcdir="src/test/java"
-                  destdir="bin/test"
-                  sourcepath=""
-                  debug="on">
-
-            <bootclasspath>
-                <fileset dir="${hy.hdk}/jdk/jre/lib/boot">
-                    <include name="**/*.jar" />
-                </fileset>
-            </bootclasspath>
-            <classpath>
-                <pathelement path="${hy.jdk}/lib/tools.jar"/>
-                <pathelement path="${junit.jar}"/>
-            </classpath>
-            <classpath location="bin/test" />
+    <target name="-test-jar" unless="skip.test.build"
+            depends="svn-info,-compile-tests">
+        <mkdir dir="${tests.hdk.dir}" />
 
-            <!-- temporarely exclude one test that breaks compilation -->
-            <exclude name="**/javah/Test02.java"/>
-        </hy.javac>
-    </target>
-
-    <target name="prepare-exclude">
-        <echo message="${hy.module} exclude list: ${tools.exclude.file}" />
-        <prepare-exclude-list moduleName="${hy.module}" dir="./make"
-                             result="${tools.exclude.file}" />
-    </target>
+        <copy file="make/run-test.xml" tofile="${tests.hdk.dir}/build.xml" />
 
-    <target name="run-tests" depends="build-tests, prepare-exclude">
-
-        <property name="test.jre.home" value="${hy.jre}" />
-
-        <echo message="Running ${hy.module} tests" />
-        <echo message="test.jre.home=${test.jre.home}" />
-
-        <mkdir dir="${tests.output}" />
-
-        <junit fork="yes"
-                       forkmode="${hy.test.forkmode}"
-                       timeout="${hy.test.timeout}"
-                       printsummary="withOutAndErr"
-                       errorproperty="test.errors"
-                       failureproperty="test.failures"
-                       showoutput="on"
-                       dir="${tests.output}"
-                       jvm="${test.jre.home}/bin/java">
-
-            <jvmarg line="${hy.test.vmargs}" />
-
-            <classpath>
-                <pathelement path="bin/test"/>
-                <pathelement path="${hy.jdk}/lib/tools.jar"/>
-            </classpath>
-
-            <formatter type="xml" />
-
-            <test name="${test.case}" todir="${tests.output}"
-                              if="test.case" />
-
-            <batchtest todir="${tests.output}" haltonfailure="no"
-                                   unless="test.case">
-
-                <fileset dir="src/test/java">
-                    <!-- if ${test.case}     -->
-                    <include name="${converted.tc}" if="test.case" />
-
-                    <!-- unless ${test.case} -->
-                    <include name="**/*Test.java" unless="test.case" />
-                    <excludesfile name="${tools.exclude.file}" unless="test.case" />
-                </fileset>
-            </batchtest>
-        </junit>
-        <antcall target="touch-failures-file" />
-        <antcall target="touch-errors-file" />
-    </target>
+        <hy.jar.bin destfile="${tests.hdk.dir}/${hy.module}_tests.jar">
+            <fileset dir="bin/test" />
+        </hy.jar.bin>
 
-    <target name="touch-failures-file" if="test.failures">
-        <echo file="${tests.output}/test.failures"
-            append="true">${hy.module}${line.separator}</echo>
-    </target>
+        <mkdir dir="${tests.excludes.hdk.dir}"/>
+        <copy todir="${tests.excludes.hdk.dir}">
+            <fileset dir="make" includes="exclude*"/>
+            <filterchain>
+                <tokenfilter>
+                    <replaceregex pattern="\.java" replace="\.class" flags="g"/>
+                </tokenfilter>
+            </filterchain>
+        </copy>
+     </target>
 
-    <target name="touch-errors-file" if="test.errors">
-        <echo file="${tests.output}/test.errors"
-            append="true">${hy.module}${line.separator}</echo>
-    </target>
+    <target name="-compile-tests" unless="skip.test.build">
+        <compile-tests description="${hy.module} tests">
+            <javac-elements>
+                <src>
+                    <pathelement location="src/test/java" />
+                </src>
+                <classpath>
+                    <pathelement path="${hy.jdk}/lib/tools.jar"/>
+                </classpath>
+
+                <!-- temporarely exclude one test that breaks compilation -->
+                <exclude name="**/javah/Test02.java"/>
+            </javac-elements>
+        </compile-tests>
+    </target>
+
+    <target name="-run-tests" depends="-test-jar">
+        <ant dir="${tests.hdk.dir}" target="test-module" />
+     </target>
 
 </project>

Added: harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/make/run-test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/make/run-test.xml?rev=938121&view=auto
==============================================================================
--- harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/make/run-test.xml (added)
+++ harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/make/run-test.xml Mon Apr
26 16:49:50 2010
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<project name="Harmony JDK tools Test" default="test" basedir=".">
+
+    <property name="hy.hdk" location="../../.." />
+    <property name="test.jre.home" location="${hy.hdk}/jdk/jre" />
+    <property file="../test.properties" />
+
+    <property name="work.dir" value=".." />
+    <property name="target.dir" value=".." />
+    <property name="tests.output" location="../report" />
+    <property name="junit.jar" location="../junit.jar" />
+
+    <import file="../../ant/properties.xml" />
+
+    <target name="test" depends="test-module" />
+
+    <target name="test-module" depends="test-jre-vm-info">
+        <convert-test-as-class from="test.case" to="converted.tc.class" />
+        <run-hdk-tests module="jdktools" jar="jdktools_tests.jar">
+            <junit-elements>
+                <classpath location="${hy.jdk}/lib/tools.jar"/>
+            </junit-elements>
+        </run-hdk-tests>
+    </target>
+</project>

Propchange: harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/make/run-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message