harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r574853 - in /harmony/enhanced/drlvm/trunk/build/make/targets: cunit.test.xml smoke.test.xml test.common.xml
Date Wed, 12 Sep 2007 09:05:25 GMT
Author: varlax
Date: Wed Sep 12 02:05:24 2007
New Revision: 574853

URL: http://svn.apache.org/viewvc?rev=574853&view=rev
Log:
More informative error message in junit report + more robust conversion to xml report.

Modified:
    harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml
    harmony/enhanced/drlvm/trunk/build/make/targets/smoke.test.xml
    harmony/enhanced/drlvm/trunk/build/make/targets/test.common.xml

Modified: harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml?rev=574853&r1=574852&r2=574853&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/targets/cunit.test.xml Wed Sep 12 02:05:24 2007
@@ -249,10 +249,12 @@
                     <equals arg1="${resultproperty}" arg2="0" />
                 </condition>
 
+                <escape-cdata file="${cunit.test.dir}/reports/${filename}.out" property="@{file}.msg"/>
                 <to-junit-xml xml="${cunit.test.dir}/reports/TEST-${filename}.xml" 
                     suite="${filename}"
                     status="${@{file}.status}"
-                    out="${outputproperty}"/>
+                    out="${outputproperty}"
+                    msg="Exit code: ${resultproperty} Err: ${@{file}.msg}"/>
                 
                 <if>
                     <istrue value="${@{file}.status}"/>

Modified: harmony/enhanced/drlvm/trunk/build/make/targets/smoke.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/targets/smoke.test.xml?rev=574853&r1=574852&r2=574853&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/targets/smoke.test.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/targets/smoke.test.xml Wed Sep 12 02:05:24 2007
@@ -205,8 +205,23 @@
                             <env key="LD_LIBRARY_PATH" value="${test.jre.home}/bin:${env.LD_LIBRARY_PATH}"
/>
                         </java>
 
-                        <loadfile property="@{test}.out" srcFile="${test.report}.out"
/>
-                        <loadfile property="@{test}.err" srcFile="${test.report}.out.err"
/>
+                        <loadfile property="@{test}.out" srcFile="${test.report}.out">
+                            <filterchain>
+                                <tokenfilter>
+                                    <!-- Should escape CDATA end marker -->
+                                    <replaceregex pattern="]]>" replace="]]&amp;gt;"
flags="gi"/>
+                                </tokenfilter>
+                            </filterchain>
+                        </loadfile>
+                        <loadfile property="@{test}.err" srcFile="${test.report}.out.err">
+                            <filterchain>
+                                <tokenfilter>
+                                    <!-- Should escape CDATA end marker -->
+                                    <replaceregex pattern="]]>" replace="]]&amp;gt;"
flags="gi"/>
+                                </tokenfilter>
+                            </filterchain>
+                        </loadfile>
+
                         <!-- loadfile does not define the property if file is empty -->
                         <property name="@{test}.out" value=""/>
                         <property name="@{test}.err" value=""/>
@@ -240,9 +255,13 @@
                                 </or>
                             </and>
                         </condition>
+
+                        <escape-cdata file="${test.report}.out.err" property="@{test}.msg"/>
                         <to-junit-xml xml="${smoke.test.dir}/reports/TEST-${class.name}_${mode.id}.xml"
-                            suite="${class.name}_${mode.id}" test="${mode.name}" status="${@{test}.is.passed}"
-                            out="${@{test}.out}" err="${@{test}.err}"/>
+                            suite="${class.name}_${mode.id}" test="${mode.name}" 
+                            status="${@{test}.is.passed}"
+                            out="${@{test}.out}" err="${@{test}.err}" 
+                            msg="Exit code: ${res.code} Err: ${@{test}.msg}"/>
 
                         <if>
                             <istrue value="${@{test}.is.passed}" />

Modified: harmony/enhanced/drlvm/trunk/build/make/targets/test.common.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/targets/test.common.xml?rev=574853&r1=574852&r2=574853&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/targets/test.common.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/targets/test.common.xml Wed Sep 12 02:05:24 2007
@@ -129,6 +129,25 @@
             </if>
         </sequential>
     </macrodef>
+    
+    <macrodef name="escape-cdata">
+        <attribute name="file"/>
+        <attribute name="property"/>
+        <sequential>
+            <loadfile property="@{property}" srcFile="@{file}" >
+                <filterchain>
+                    <escapeunicode/>
+                    <tokenfilter>
+                        <replaceregex pattern="&amp;" replace="&amp;#38;" flags="gi"/>
+                        <replaceregex pattern="&lt;" replace="&amp;#60;" flags="gi"/>
+                        <replaceregex pattern=">" replace="&amp;#62;" flags="gi"/>
+                        <replaceregex pattern="&quot;" replace="&amp;#34;" flags="gi"/>
+                        <replaceregex pattern="'" replace="&amp;#39;" flags="gi"/>
+                    </tokenfilter>
+                </filterchain>
+            </loadfile>
+        </sequential>
+    </macrodef>
 
     <macrodef name="to-junit-xml">
         <attribute name="xml" description="name of xml file"/>
@@ -138,6 +157,7 @@
         <attribute name="out" default="" description="test output"/>
         <attribute name="err" default="" description="test error"/>
         <attribute name="time" default="0.01" description="test execution time"/>
+        <attribute name="msg" default="FAILED" description="error message"/>
         <sequential>
             <echo file="@{xml}"><![CDATA[<?xml version="1.0" encoding="UTF-8"
?>
             <testsuite errors="0" failures="@F@" name="@SUITE@" tests="1" time="@TIME@">
@@ -149,7 +169,7 @@
             <condition property="@{xml}.failed" value="0" else="1">
                 <istrue value="@{status}"/>
             </condition>
-            <condition property="@{xml}.message" value="" else="&lt;failure message='FAILED'/>">
+            <condition property="@{xml}.message" value="" else="&lt;failure message='@{msg}'/>">
                 <istrue value="@{status}"/>
             </condition>
             <condition property="@{xml}.out" value="]" else="@{out}]">



Mime
View raw message