harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r937898 - /harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/build.xml
Date Sun, 25 Apr 2010 22:06:43 GMT
Author: hindessm
Date: Sun Apr 25 22:06:43 2010
New Revision: 937898

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

Modified:
    harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/build.xml

Modified: harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/build.xml?rev=937898&r1=937897&r2=937898&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/build.xml (original)
+++ harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/build.xml Sun Apr 25 22:06:43
2010
@@ -27,14 +27,10 @@
     <import file="${hy.hdk}/build/ant/depends.xml" />
     <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/jretools.exclude" />
     
-    <target name="build" depends="build-jar" />
+    <target name="build" depends="-build-jar,-test-jar" />
 
-    <target name="test" depends="test-module">
+    <target name="test" depends="-test-module">
         <fail message="Some tests failed">
             <condition>
                 <or>
@@ -46,18 +42,22 @@
     </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">
         <delete file="${hy.jre}/lib/tools.jar" />
         <delete file="${hy.jre}/lib/tools-src.jar" />
         <delete dir="bin" 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"/>
+    </target>
+
+    <target name="-compile-java" unless="skip.java.build">
         <echo message="Compiling ${hy.module} classes" />
         <ensure-javac/>
         <mkdir dir="bin/main" />
@@ -66,8 +66,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">
@@ -77,7 +79,15 @@
         </hy.javac>
     </target>
 
-    <target name="build-jar" depends="svn-info,compile-java">
+    <target name="findbugs" depends="-build-jar">
+        <run-findBugs
+            jarFile="${hy.jre}/lib/tools.jar"
+            excludeFilter="make/findbugs-exclude-filter.xml"
+            outputFile="${findBugs.report}/jretools.xml"/>
+    </target>
+
+    <target name="-build-jar" unless="skip.java.build"
+            depends="svn-info,-compile-java">
         <mkdir dir="${hy.jre}/lib" />
 
         <hy.jar.bin destfile="${hy.jre}/lib/tools.jar"
@@ -93,94 +103,45 @@
         </hy.jar.src>
     </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">
+    <target name="-test-jar" unless="skip.test.build"
+            depends="svn-info,-compile-tests">
+        <mkdir dir="${tests.hdk.dir}" />
 
-            <bootclasspath>
-                <fileset dir="${hy.hdk}/jdk/jre/lib/boot">
-                    <include name="**/*.jar" />
-                </fileset>
-            </bootclasspath>
-            <classpath>
-                <pathelement path="${hy.jre}/lib/tools.jar"/>
-                <pathelement path="${junit.jar}"/>
-            </classpath>
-            <classpath location="bin/test" />
+        <copy file="make/run-test.xml" tofile="${tests.hdk.dir}/build.xml" />
 
-            <!-- 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="jretools" dir="./make"
-                             result="${tools.exclude.file}" />
-    </target>
-
-    <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.jre}/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}/jretools_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>
+        <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="-compile-tests" unless="skip.test.build">
+        <compile-tests description="math tests">
+            <javac-elements>
+                <src>
+                    <pathelement location="src/test/java" />
+                </src>
+                <classpath>
+                    <pathelement path="${hy.jre}/lib/tools.jar"/>
+                </classpath>
+
+                <!-- temporarily exclude one test that breaks compilation -->
+                <exclude name="**/javah/Test02.java"/>
+            </javac-elements>
+        </compile-tests>
     </target>
 
-    <target name="touch-errors-file" if="test.errors">
-        <echo file="${tests.output}/test.errors"
-            append="true">${hy.module}${line.separator}</echo>
+    <target name="-run-tests" depends="-test-jar">
+        <ant dir="${tests.hdk.dir}" target="test-module" />
     </target>
 
 </project>



Mime
View raw message