harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r793804 - in /harmony/enhanced/classlib/trunk: make/properties.xml make/run-test.xml modules/luni/build.xml modules/luni/make/run-test.xml
Date Tue, 14 Jul 2009 07:27:22 GMT
Author: hindessm
Date: Tue Jul 14 07:27:21 2009
New Revision: 793804

URL: http://svn.apache.org/viewvc?rev=793804&view=rev
Log:
Make hdk test ant files modular and support -D{build,exclude}.module.

Added:
    harmony/enhanced/classlib/trunk/modules/luni/make/run-test.xml   (with props)
Modified:
    harmony/enhanced/classlib/trunk/make/properties.xml
    harmony/enhanced/classlib/trunk/make/run-test.xml
    harmony/enhanced/classlib/trunk/modules/luni/build.xml

Modified: harmony/enhanced/classlib/trunk/make/properties.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/make/properties.xml?rev=793804&r1=793803&r2=793804&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/make/properties.xml (original)
+++ harmony/enhanced/classlib/trunk/make/properties.xml Tue Jul 14 07:27:21 2009
@@ -622,4 +622,106 @@
        </javac>
    </presetdef>
 
+    <macrodef name="run-hdk-tests">
+        <attribute name="module" />
+        <attribute name="jar" />
+        <element name="junit-elements" optional="true"/>
+        <element name="excludeorinclude" optional="true"/>
+        <sequential>
+            <echo message="Running @{module} Unit Test from @{jar}" />
+            <echo message="Tested jre: ${test.jre.home}/bin/java" />
+            <property name="test.module.dir" value="${target.dir}/@{module}" />
+            <property name="test.excludes.dir" value="${test.module.dir}/excludes" />
+            <property name="test.resources.dir" value="${test.module.dir}/resources" />
+            <property name="test.exclude.file" value="${work.dir}/@{module}.exclude" />
+            
+            <mkdir dir="${test.report.dir}/@{module}" /> 
+
+            <prepare-exclude-list moduleName="@{module}" dir="${test.excludes.dir}" result="${test.exclude.file}"
/>
+            <junit fork="yes" 
+                   forkmode="${hy.test.forkmode}" 
+                   timeout="${hy.test.timeout}" 
+                   printsummary="withOutAndErr" 
+                   errorproperty="test.errors" 
+                   failureproperty="test.failures" 
+                   showoutput="on" 
+                   dir="${work.dir}/@{module}" 
+                   tempdir="${work.dir}"
+                   jvm="${test.jre.home}/bin/java">
+
+                <classpath>
+                    <fileset dir="${target.dir}">
+                        <include name="*.jar" />
+                    </fileset>
+                    <pathelement path="${test.resources.dir}/" />
+                    <pathelement path="${test.module.dir}/" />
+                    <pathelement location="${test.module.dir}/@{jar}" />
+                </classpath>
+
+                <junit-elements />
+
+                <batchtest todir="${test.report.dir}/@{module}" haltonfailure="no">
+                    <zipfileset src="${test.module.dir}/@{jar}">
+                        <exclude name="Test.class" />
+                        <exclude name="**/*$*" />
+
+                        <!-- if ${test.case}     -->
+                        <include name="${converted.tc.class}" if="test.case" />
+                        <!-- unless ${test.case} -->
+                        <include name="**/*Test.class" unless="test.case" />
+                        <excludesfile name="${test.exclude.file}" unless="test.case"/>
+                        <excludeorinclude/>
+                    </zipfileset>
+                </batchtest>
+
+                <assertions enableSystemAssertions="true">
+                    <enable />
+                </assertions>
+
+                <jvmarg line="${hy.test.vmargs}" />
+                <!-- Used by Support_Exec.execJava() -->
+                <jvmarg value="-Dhy.test.vmargs=${hy.test.vmargs}" />
+
+                <formatter type="xml" />
+            </junit>
+
+            <antcall target="touch-failures-file">
+                <param name="module" value="@{module}" />
+            </antcall>
+            <antcall target="touch-errors-file">
+                <param name="module" value="@{module}" />
+            </antcall>
+
+        </sequential>
+    </macrodef>
+
+    <target name="touch-failures-file" if="test.failures">
+        <echo file="${test.report.dir}/test.failures"
+            append="true">${module}${line.separator}</echo>
+    </target>
+
+    <target name="touch-errors-file" if="test.errors">
+        <echo file="${test.report.dir}/test.errors"
+            append="true">${module}${line.separator}</echo>
+    </target>
+
+    <!-- To use with -Dtest.case=... option                   -->
+    <!-- if ${test.case} is provided in package+class form    -->
+    <!-- it is converted to dir+filename form                 -->
+    <macrodef name="convert-test-as-class">
+        <attribute name="from" />
+        <attribute name="to" />
+        <sequential>
+            <pathconvert property="@{to}" setonempty="no">
+                <path path="${@{from}}" />
+                <chainedmapper>
+                    <filtermapper>
+                        <replaceregex pattern="\.java$$" />
+                    </filtermapper>
+                    <unpackagemapper from="${basedir}${file.separator}*" to="*.class"
/>
+                </chainedmapper>
+            </pathconvert>
+        </sequential>
+    </macrodef>
+
 </project>

Modified: harmony/enhanced/classlib/trunk/make/run-test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/make/run-test.xml?rev=793804&r1=793803&r2=793804&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/make/run-test.xml (original)
+++ harmony/enhanced/classlib/trunk/make/run-test.xml Tue Jul 14 07:27:21 2009
@@ -30,51 +30,14 @@
     <property name="junit.jar" value="${target.dir}/junit.jar" />
 
     <target name="test"
-            depends="test-jre-vm-info,-test,test-module,gen-report,check-test-result" />
+            depends="test-jre-vm-info,-test,gen-report,check-test-result" />
+
     <target name="-test">
         <echo message="Test Work Dir: ${work.dir}" />
         <echo message="Test Target Dir: ${target.dir}" />
         <mkdir dir="${work.dir}" /> 
         <delete dir="${test.report.dir}" quiet="true"/>
-        <convert-test-as-class from="test.case" to="converted.tc.class" />
-    </target>
-    
-    <target name="test-module">
-        <antcall target="test-${build.module}" />
-    </target>
-
-    <target name="test-all" depends="test-luni">
-        <!--TODO: will add all modules as depends -->
-    </target>
-    
-    <target name="test-luni">
-        <run-tests module="luni" jar="luni_tests_api.jar">
-            <junit-elements>
-                <!-- Required by various tests that set security manager etc -->
-                <jvmarg value="-Djava.security.policy=${target.dir}/../testing.policy"
/>
-
-                <!-- Required for running the java.net unit tests -->
-                <jvmarg value="-Dtest.ini.file=${target.dir}/resources/config/localhosttest.ini"
/>
-            </junit-elements>
-        </run-tests>    
-
-        <run-tests module="luni" jar="luni_tests_impl.jar">
-            <junit-elements>
-                <!-- Required by various tests that set security manager etc -->
-                <jvmarg value="-Djava.security.policy=${target.dir}/../testing.policy"
/>
-
-                <!-- Required for running the java.net unit tests -->
-                <jvmarg value="-Dtest.ini.file=${target.dir}/resources/config/localhosttest.ini"
/>
-            </junit-elements>
-        </run-tests>
-    </target>
-    
-    <target name="touch-failures-file" if="test.failures">
-        <echo file="${work.dir}/report/test.failures" append="true">failure${line.separator}</echo>
-    </target>
-
-    <target name="touch-errors-file" if="test.errors">
-        <echo file="${work.dir}/report/test.errors" append="true">error${line.separator}</echo>
+        <poll-modules dir="." target="test-module" />
     </target>
 
     <target name="check-test-result">
@@ -96,92 +59,4 @@
         <echo message="The test report is in ${display-location}"/>
     </target>
     
-    <macrodef name="run-tests">
-        <attribute name="module" />
-        <attribute name="jar" />
-        <element name="junit-elements" optional="true"/>
-        <element name="excludeorinclude" optional="true"/>
-        <sequential>
-            <echo message="Running @{module} Unit Test from @{jar}" />
-            <echo message="Tested jre: ${test.jre.home}/bin/java" />
-            <property name="test.module.dir" value="${target.dir}/@{module}" />
-            <property name="test.excludes.dir" value="${test.module.dir}/excludes" />
-            <property name="test.resources.dir" value="${test.module.dir}/resources" />
-            <property name="test.exclude.file" value="${work.dir}/@{module}.exclude" />
-            
-            <mkdir dir="${test.report.dir}/@{module}" /> 
-
-            <prepare-exclude-list moduleName="@{module}" dir="${test.excludes.dir}" result="${test.exclude.file}"
/>
-            <junit fork="yes" 
-                   forkmode="${hy.test.forkmode}" 
-                   timeout="${hy.test.timeout}" 
-                   printsummary="withOutAndErr" 
-                   errorproperty="test.errors" 
-                   failureproperty="test.failures" 
-                   showoutput="on" 
-                   dir="${work.dir}/@{module}" 
-                   tempdir="${work.dir}"
-                   jvm="${test.jre.home}/bin/java">
-
-                <classpath>
-                    <fileset dir="${target.dir}">
-                        <include name="*.jar" />
-                    </fileset>
-                    <pathelement path="${test.resources.dir}/" />
-                    <pathelement path="${test.module.dir}/" />
-                    <pathelement location="${test.module.dir}/@{jar}" />
-                </classpath>
-
-                <junit-elements />
-
-                <batchtest todir="${test.report.dir}/@{module}" haltonfailure="no">
-                    <zipfileset src="${test.module.dir}/@{jar}">
-                        <exclude name="Test.class" />
-                        <exclude name="**/*$*" />
-
-                        <!-- if ${test.case}     -->
-                        <include name="${converted.tc.class}" if="test.case" />
-                        <!-- unless ${test.case} -->
-                        <include name="**/*Test.class" unless="test.case" />
-                        <excludesfile name="${test.exclude.file}" unless="test.case"/>
-                        <excludeorinclude/>
-                    </zipfileset>
-                </batchtest>
-
-                <assertions enableSystemAssertions="true">
-                    <enable />
-                </assertions>
-
-                <jvmarg line="${hy.test.vmargs}" />
-                <!-- Used by Support_Exec.execJava() -->
-                <jvmarg value="-Dhy.test.vmargs=${hy.test.vmargs}" />
-
-                <formatter type="xml" />
-            </junit>
-
-            <antcall target="touch-failures-file" />
-            <antcall target="touch-errors-file" />
-
-        </sequential>
-    </macrodef>
-
-    <!-- To use with -Dtest.case=... option                   -->
-    <!-- if ${test.case} is provided in package+class form    -->
-    <!-- it is converted to dir+filename form                 -->
-    <macrodef name="convert-test-as-class">
-        <attribute name="from" />
-        <attribute name="to" />
-        <sequential>
-            <pathconvert property="@{to}" setonempty="no">
-                <path path="${@{from}}" />
-                <chainedmapper>
-                    <filtermapper>
-                        <replaceregex pattern="\.java$$" />
-                    </filtermapper>
-                    <unpackagemapper from="${basedir}${file.separator}*" to="*.class"
/>
-                </chainedmapper>
-            </pathconvert>
-        </sequential>
-    </macrodef>
-
 </project>

Modified: harmony/enhanced/classlib/trunk/modules/luni/build.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/build.xml?rev=793804&r1=793803&r2=793804&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/build.xml (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/build.xml Tue Jul 14 07:27:21 2009
@@ -303,6 +303,9 @@
     <target name="test-jar" depends="compile-tests, prepare-exclude">
         <mkdir dir="${tests.hdk.dir}"/>
 
+        <copy file="make/run-test.xml"
+              tofile="${tests.hdk.dir}/build.xml" />
+
         <jar destfile="${tests.hdk.dir}/luni_tests_api.jar">
             <fileset refid="tests.api" />
             <manifest>

Added: harmony/enhanced/classlib/trunk/modules/luni/make/run-test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/make/run-test.xml?rev=793804&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/make/run-test.xml (added)
+++ harmony/enhanced/classlib/trunk/modules/luni/make/run-test.xml Tue Jul 14 07:27:21 2009
@@ -0,0 +1,55 @@
+<?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 LUNI Test" default="test" basedir=".">
+
+    <property name="test.jre.home" location="../../../jdk/jre" />
+    <property file="../test.properties" />
+    <import file="../properties.xml" />
+
+    <property name="work.dir" value=".." />
+    <property name="target.dir" value=".." />
+    <property name="test.report.dir" location="../report" />
+    <property name="junit.jar" location="../junit.jar" />
+
+    <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="luni" jar="luni_tests_api.jar">
+            <junit-elements>
+                <!-- Required by various tests that set security manager etc -->
+                <jvmarg value="-Djava.security.policy=../testing.policy" />
+
+                <!-- Required for running the java.net unit tests -->
+                <jvmarg value="-Dtest.ini.file=resources/config/localhosttest.ini" />
+            </junit-elements>
+        </run-hdk-tests>    
+
+        <run-hdk-tests module="luni" jar="luni_tests_impl.jar">
+            <junit-elements>
+                <!-- Required by various tests that set security manager etc -->
+                <jvmarg value="-Djava.security.policy=../testing.policy" />
+
+                <!-- Required for running the java.net unit tests -->
+                <jvmarg value="-Dtest.ini.file=resources/config/localhosttest.ini" />
+            </junit-elements>
+        </run-hdk-tests>
+    </target>
+    
+</project>

Propchange: harmony/enhanced/classlib/trunk/modules/luni/make/run-test.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message