harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r488051 - /harmony/enhanced/classlib/trunk/make/build-test.xml
Date Sun, 17 Dec 2006 21:18:16 GMT
Author: ayza
Date: Sun Dec 17 13:18:15 2006
New Revision: 488051

URL: http://svn.apache.org/viewvc?view=rev&rev=488051
Log:
Empty reports processing was added. This is the completely refactored version of the patch
from HARMONY-2349.

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

Modified: harmony/enhanced/classlib/trunk/make/build-test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/make/build-test.xml?view=diff&rev=488051&r1=488050&r2=488051
==============================================================================
--- harmony/enhanced/classlib/trunk/make/build-test.xml (original)
+++ harmony/enhanced/classlib/trunk/make/build-test.xml Sun Dec 17 13:18:15 2006
@@ -38,7 +38,7 @@
 
     <!-- this list of components to test will grow to eventually be all modules -->
     <target name="test-all"
-        depends="clean, test-modules, gen-report, check-test-result">
+        depends="clean, test-modules, process-empty, gen-report, check-test-result">
     </target>
 
     <target name="clean">
@@ -129,6 +129,8 @@
     </target>
     
     <target name="check-test-result">
+        <fail if="test.crashes"
+              message="There were test crashes: ${crashed.tests}"/>
         <available property="test.errors"
                    file="${tests.output}/test.errors" />
         <available property="test.failures"
@@ -250,6 +252,51 @@
         </fail>
         <!-- Clean up after ourselves -->
         <delete file="${user.home}/junitCompleted" />
+    </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