harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r541181 - /harmony/enhanced/jdktools/trunk/make/build-test.xml
Date Thu, 24 May 2007 05:34:01 GMT
Author: smishura
Date: Wed May 23 22:34:01 2007
New Revision: 541181

URL: http://svn.apache.org/viewvc?view=rev&rev=541181
Log:
Copy from classlib build targets that process empty xml report files

Modified:
    harmony/enhanced/jdktools/trunk/make/build-test.xml

Modified: harmony/enhanced/jdktools/trunk/make/build-test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/jdktools/trunk/make/build-test.xml?view=diff&rev=541181&r1=541180&r2=541181
==============================================================================
--- harmony/enhanced/jdktools/trunk/make/build-test.xml (original)
+++ harmony/enhanced/jdktools/trunk/make/build-test.xml Wed May 23 22:34:01 2007
@@ -41,7 +41,7 @@
 
     <!-- this list of components to test will grow to eventually be all modules -->
     <target name="test-all"
-        depends="clean-tests-output, test-modules, gen-report, check-test-result">
+        depends="clean-tests-output, test-modules, process-empty, gen-report, check-test-result">
     </target>
 
     <target name="clean" depends="clean-tests-output, clean-tests, clean-jre" />
@@ -112,6 +112,51 @@
 
     <target name="clean-jre">
         <delete dir="${hy.jdk}/jre" />
+    </target>
+
+    <target name="process-empty" depends="-check-for-empty, -process-empty"/>
+    <target name="-check-for-empty">
+        <fileset id="empty.test.reports" dir="${tests.output}">
+            <patternset>
+                <include name="TEST-*.xml"/>
+            </patternset>
+            <size value="0" when="equal"/>
+        </fileset>
+
+        <pathconvert refid="empty.test.reports" pathsep="${path.separator}"
+                     property="crashed.tests"/>
+        <condition property="test.crashes">
+            <not>
+                <equals arg1="" arg2="${crashed.tests}" />
+            </not>
+        </condition>
+    </target>
+    <target name="-process-empty" if="test.crashes">
+       <property name="per.crashed.tests.file" 
+                 value="${tests.output}${file.separator}TEST-crashed.xml"/>
+
+       <property name="per.header"
+                 value="&lt;?xml version='1.0' encoding='UTF-8' ?&gt;&lt;testsuite
errors='1' name='vmcrash.CrashedTests' time='0'&gt;"/>
+       <property name="per.prefix"
+                 value="&lt;testcase classname='"/>
+       <property name="per.middle" value="' name='"/>
+       <property name="per.suffix" 
+                 value="' time='0.0'&gt;&lt;error message='VM crash?'/&gt;&lt;/testcase&gt;"/>
+       <property name="per.footer" value="&lt;/testsuite&gt;"/>
+
+       <echo message="${crashed.tests}" file="${per.crashed.tests.file}"/>
+
+       <replaceregexp file="${per.crashed.tests.file}" flags="g">
+            <regexp pattern="[^${path.separator}]*TEST-([^${path.separator}]*)\.xml${path.separator}?"/>
+            <substitution expression="${per.prefix}\1${per.middle}\1${per.suffix}"/>
+       </replaceregexp>
+       <replaceregexp file="${per.crashed.tests.file}" match="\A"
+                      replace="${per.header}"/>
+       <echo file="${per.crashed.tests.file}" append="yes"
+             message="${per.footer}"/>
+
+       <!-- now let's delete empty reports -->
+       <delete><fileset refid="empty.test.reports"/></delete>
     </target>
 
 </project>



Mime
View raw message