You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by va...@apache.org on 2007/10/15 13:28:24 UTC

svn commit: r584742 - in /harmony/enhanced/drlvm/trunk/build/make: targets/ehwa.test.xml targets/kernel.test.xml targets/reg.test.run.xml test.properties

Author: varlax
Date: Mon Oct 15 04:28:22 2007
New Revision: 584742

URL: http://svn.apache.org/viewvc?rev=584742&view=rev
Log:
Aligned ehwa, kernel and reg tests with latest changes in testing framework:
- support of failures file;
- minor cleanup in ehwa and reg-test scripts;

Modified:
    harmony/enhanced/drlvm/trunk/build/make/targets/ehwa.test.xml
    harmony/enhanced/drlvm/trunk/build/make/targets/kernel.test.xml
    harmony/enhanced/drlvm/trunk/build/make/targets/reg.test.run.xml
    harmony/enhanced/drlvm/trunk/build/make/test.properties

Modified: harmony/enhanced/drlvm/trunk/build/make/targets/ehwa.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/targets/ehwa.test.xml?rev=584742&r1=584741&r2=584742&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/targets/ehwa.test.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/targets/ehwa.test.xml Mon Oct 15 04:28:22 2007
@@ -17,49 +17,22 @@
 -->
 <project name="Eclipse HelloWorld test scenario">
 
-    <property name="test.jvm.exe" value="${build.deploy.dir}/jdk/jre/bin/java"/>
-    <property file="test.properties"/>
+    <import file="test.common.xml"/>
+    <property name="ehwa.test.dir" location="${base.test.dir}/ehwa"/>
+    <property name="ehwa.test.summary" location="${ehwa.test.dir}/status.txt"/>
+
     <property environment="env" />
     
-    <condition property="os" value="win">
-        <os family="Windows" />
-    </condition>
-    <condition property="os" value="linux">
-        <os name="linux" />
-    </condition>
-    <condition property="os" value="macosx">
-        <os name="mac os x" />
-    </condition>
-    <condition property="arch" value="x86_64">
-        <or>
-            <equals arg1="x86_64" arg2="${os.arch}"/>
-            <equals arg1="amd64" arg2="${os.arch}"/>
-        </or>
-    </condition>
-    <condition property="arch" value="x86">
-        <or>
-            <equals arg1="x86" arg2="${os.arch}"/>
-            <equals arg1="i386" arg2="${os.arch}"/>
-        </or>
-    </condition>
-    <condition property="arch" value="ia64">
-        <equals arg1="ia64" arg2="${os.arch}"/>
-    </condition>
-    <condition property="arch" value="ppc32">
-        <or>
-            <equals arg1="${os.arch}" arg2="ppc32" />
-            <equals arg1="${os.arch}" arg2="ppc" />
-        </or>
-    </condition>
-
-    <propertycopy name="eclipse.url" from="eclipse.${os}.${arch}.url"/>
+    <propertycopy name="eclipse.url" from="eclipse.${hy.platform}.url"/>
     <basename file="${eclipse.url}" property="eclipse.zip"/>
 
     <target name="ehwa" depends="setup-ehwa, run-ehwa, check-ehwa-result"/>
 
     <target name="setup-ehwa" depends="check-depends, install-eclipse, install-plugin">
-        <delete quiet="true" file="${build.semi.dir}/ehwa/ehwa.status" />
-        <echo>Using Eclipse located at ${eclipse.home}</echo>
+        <delete quiet="true" file="${ehwa.test.summary}" />
+        <delete quiet="true" file="${base.test.dir}/ehwa.test.failed" />
+        <property file="${eclipse.home}/.eclipseproduct" prefix="eclipseproduct"/>
+        <echo>Using Eclipse ${eclipseproduct.version} located at ${eclipse.home}</echo>
     </target>
 
     <target name="run-ehwa">
@@ -74,7 +47,7 @@
     </target>
     
     <target name="-run-ehwa-batch">
-        <property name="ehwa.workspace" value="${build.semi.dir}/ehwa/wksp"/>
+        <property name="ehwa.workspace" value="${ehwa.test.dir}/wksp"/>
         <delete quiet="true" dir="${ehwa.workspace}" />
         <mkdir dir="${ehwa.workspace}"/>
         <propertycopy property="ehwa.mode.name" from="${ehwa.mode}.name" override="on"/>
@@ -84,11 +57,22 @@
         Run Eclipse HelloWorld using ${ehwa.mode.name}
         ==================================
         </echo>
+        <pathconvert property="equinox.launcher" setonempty="false">
+            <path>
+                <fileset dir="${eclipse.home}/plugins" includes="org.eclipse.equinox.launcher_1.0.0.*.jar"/>
+            </path>
+        </pathconvert>
+        <condition property="eclipse.launcher.jar" 
+            value="${equinox.launcher}" 
+            else="${eclipse.home}/startup.jar">
+            <isset property="equinox.launcher"/>
+        </condition>
 
-        <java fork="true" jvm="${test.jvm.exe}" jar="${eclipse.home}/startup.jar" resultproperty="ehwa.result">
-            <jvmarg line="-XX:-vm.assert_dialog ${ehwa.mode.switch} ${test.vmargs}" />
+        <java fork="true" jvm="${test.jvm.exe}" jar="${eclipse.launcher.jar}" 
+            resultproperty="ehwa.result">
+            <jvmarg line="${ehwa.mode.switch} ${test.vmargs}" />
             <arg line="-application org.eclipse.test.uitestapplication"/>
-            <arg line="-dev bin"/>
+            <arg line="-dev bin -consolelog"/>
             <arg line="-data ${ehwa.workspace}"/>
             <arg line="formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter"/>
             <arg line="-testPluginName HelloAuto"/>
@@ -97,35 +81,46 @@
         <condition property="ehwa.status" value="PASSED" else="FAILED">
             <equals arg1="${ehwa.result}" arg2="0"/>
         </condition>
-        <concat append="on" destfile="${build.semi.dir}/ehwa/ehwa.status" 
+        <concat append="on" destfile="${ehwa.test.summary}" 
             >      ${ehwa.mode.name} ${ehwa.status} (Return code is ${ehwa.result})${line.separator}</concat>
     </target>
 
     <target name="check-ehwa-result">
-        <loadfile property="ehwa.test.summary" 
-            srcFile="${build.semi.dir}/ehwa/ehwa.status"/>
+        <loadfile property="ehwa.test.summary.txt" 
+            srcFile="${ehwa.test.summary}"/>
         <echo message="  ***************************${line.separator}"/>
         <echo message="  **** Eclipse HWA status ***${line.separator}"/>
         <echo message="  ***************************${line.separator}"/>
         <echo message="${line.separator}"/>
-        <echo message="${ehwa.test.summary}"/>
+        <echo message="${ehwa.test.summary.txt}"/>
         <echo message="${line.separator}"/>
-
         <condition property="test.failed">
-            <contains string="${ehwa.test.summary}" substring="FAILED" />
+            <contains string="${ehwa.test.summary.txt}" substring="FAILED" />
         </condition>
+        <antcall target="touch-failures-file"/>
         <fail unless="run.all.tests" if="test.failed" message="Eclipse HelloWorld scenario FAILED"/>
     </target>
+    
+    <target name="touch-failures-file" if="test.failed">
+        <copy file="${ehwa.test.summary}" tofile="${base.test.dir}/ehwa.test.failed">
+            <filterchain>
+                <linecontains>
+                    <contains value="FAILED"/>
+                </linecontains>
+                <trim/>
+            </filterchain>
+        </copy>
+    </target>
 
     <target name="check-depends">
         <condition property="eclipse.home" value="${env.ECLIPSE_HOME}">
             <and>
                 <isset property="env.ECLIPSE_HOME"/>
-                <available file="${env.ECLIPSE_HOME}/startup.jar"/>
+                <available file="${env.ECLIPSE_HOME}/.eclipseproduct"/>
           </and>
         </condition>
-        <condition property="eclipse.home" value="${build.semi.dir}/ehwa/eclipse">
-            <available file="${build.semi.dir}/ehwa/eclipse/startup.jar"/>
+        <condition property="eclipse.home" value="${ehwa.test.dir}/eclipse">
+            <available file="${ehwa.test.dir}/eclipse/.eclipseproduct"/>
         </condition>
         <condition property="eclipse.available">
             <or>
@@ -136,7 +131,7 @@
         <condition property="ehwa.plugin.installed">
             <and>
                 <isset property="eclipse.home"/>
-                <available file="${eclipse.home}/plugins/HelloAuto_0.0.1/HelloAuto.jar"/>
+                <available file="${eclipse.home}/plugins/HelloAuto_0.0.1"/>
             </and>
         </condition>
     </target>
@@ -147,31 +142,31 @@
     </target>
 
     <target name="install-eclipse" depends="download-eclipse" unless="eclipse.home">
-        <delete quiet="true" dir="${build.semi.dir}/ehwa" />
-        <mkdir dir="${build.semi.dir}/ehwa"/>
+        <delete quiet="true" dir="${ehwa.test.dir}" />
+        <mkdir dir="${ehwa.test.dir}"/>
         
         <if>
             <isfileselected file="${eclipse.zip}">
                 <filename name="**/*.tar.gz"/>
             </isfileselected>
             <then>
-                <gunzip src="${build.precopied.dir}/archives/${eclipse.zip}" dest="${build.semi.dir}/ehwa/eclipse.tar" />
-                <untar src="${build.semi.dir}/ehwa/eclipse.tar" dest="${build.semi.dir}/ehwa" />
-                <delete file="${build.semi.dir}/ehwa/eclipse.tar"/>
+                <gunzip src="${build.precopied.dir}/archives/${eclipse.zip}" dest="${ehwa.test.dir}/eclipse.tar" />
+                <untar src="${ehwa.test.dir}/eclipse.tar" dest="${ehwa.test.dir}" />
+                <delete file="${ehwa.test.dir}/eclipse.tar"/>
             </then>
             <elseif>
                 <isfileselected file="${eclipse.zip}">
                     <filename name="**/*.zip"/>
                 </isfileselected>
                 <then>
-                    <unzip dest="${build.semi.dir}/ehwa" src="${build.precopied.dir}/archives/${eclipse.zip}"/>
+                    <unzip dest="${ehwa.test.dir}" src="${build.precopied.dir}/archives/${eclipse.zip}"/>
                 </then>
             </elseif>
             <else>
                 <fail>Unhandled archive type: ${eclipse.zip}</fail>
             </else>
         </if>
-        <property name="eclipse.home" value="${build.semi.dir}/ehwa/eclipse"/>
+        <property name="eclipse.home" value="${ehwa.test.dir}/eclipse"/>
     </target>
 
     <target name="install-plugin" unless="ehwa.plugin.installed">

Modified: harmony/enhanced/drlvm/trunk/build/make/targets/kernel.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/targets/kernel.test.xml?rev=584742&r1=584741&r2=584742&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/targets/kernel.test.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/targets/kernel.test.xml Mon Oct 15 04:28:22 2007
@@ -31,6 +31,7 @@
     <target name="run-kernel-test">
         <prepare-test-run test-dir="${kernel.test.dir}"/>
         <delete file="${kernel.test.summary}" quiet="true"/>
+        <delete file="${base.test.dir}/kernel.test.failed" quiet="true"/>
         
         <echo>
         ==================================
@@ -70,7 +71,19 @@
         <condition property="test.failed">
             <contains string="${kernel.test.summary.txt}" substring="FAILED" />
         </condition>
+        <antcall target="touch-failures-file"/>
         <fail unless="run.all.tests" if="test.failed" message="There were test failures."/>
+    </target>
+    
+    <target name="touch-failures-file" if="test.failed">
+        <copy file="${kernel.test.summary}" tofile="${base.test.dir}/kernel.test.failed">
+            <filterchain>
+                <linecontains>
+                    <contains value="FAILED"/>
+                </linecontains>
+                <trim/>
+            </filterchain>
+        </copy>
     </target>
 
     <target name="compile-kernel-test">

Modified: harmony/enhanced/drlvm/trunk/build/make/targets/reg.test.run.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/targets/reg.test.run.xml?rev=584742&r1=584741&r2=584742&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/targets/reg.test.run.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/targets/reg.test.run.xml Mon Oct 15 04:28:22 2007
@@ -17,17 +17,14 @@
 
 <project name="REGRESSION TESTS RUN" default="do-regression-testing">
     
+    <property name="reg.test.summary" location="${base.test.dir}/reg.test.failed"/>
     <import file="test.common.xml"/>
     
-    <!-- Marker used by custom test launchers for test failure notification -->
-    <property name="reg.test.failed.mark" value="-=@@@ Reg Test Failed @@@=-"/>
-
-    <target name="do-regression-testing" 
-            depends="launch-tests,make-report,check-results">
-    </target>
+    <target name="do-regression-testing" depends="launch-tests,make-report,check-results"/>
 
     <target name="launch-tests">
         <prepare-test-run test-dir="${reg.test.dir}"/>
+        <delete file="${reg.test.summary}" quiet="true"/>
         <echo>
         =====================================
         Tested JVM: ${test.jvm.exe}
@@ -61,8 +58,9 @@
                     <then>
                         <!-- Launch the tests with a custom launchers 
                                                 placed near the tests -->
-                        <run-custom-launcher 
-                            launcher="@{reg.test.2launch.src.dir}/run.test.xml"/>
+                        <ant antfile="@{reg.test.2launch.src.dir}/run.test.xml" 
+                            target="run-test" 
+                            inheritAll="true" inheritRefs="true"/>
                     </then>
                     <else>
                         <!-- Execution of unit tests checking for regression -->
@@ -98,51 +96,10 @@
     </target>
     
     <target name="check-results">
-        <fail if="reg.test.errors" 
-            message="There were test failures"/>
+        <available property="test.failed" file="${reg.test.summary}" />
+        <fail unless="run.all.tests" if="test.failed" message="There were test failures"/>
     </target>
 
-    <!-- Macrodefinition launching the custom launcher -->
-    <macrodef name="run-custom-launcher">
-        <attribute name="launcher"/>
-        <sequential>
-            <!-- 
-                Set up try-catch block to catch the test failure.
-
-                It's possible to use <antfetch> task for this purpose:
-                    <antfetch 
-                        antfile="@{launcher}" target="run-test" 
-                        return="reg.test.errors" 
-                        inheritAll="true" inheritRefs="true"/>
-                but it fails with NPE while <macrodef> processing...
-            -->
-            <trycatch property="reg.test.failure.message"
-                      reference="reg.test.failure.reference">
-                <try>
-                    <ant antfile="@{launcher}" target="run-test" 
-                             inheritAll="true" inheritRefs="true">
-                         <property name="reg.test.custom.launched" value="true"/>
-                    </ant>
-                </try>
-                <catch>
-                    <if>
-                        <!-- it was a test failure -->
-                        <contains string="${reg.test.failure.message}" 
-                                  substring="${reg.test.failed.mark}"/>
-                        <then>
-                            <!-- set up the property -->
-                            <property name="reg.test.errors" value="true"/>
-                        </then>
-                        <else>
-                            <!-- propagate the error -->
-                            <throw refid="reg.test.failure.reference"/>
-                        </else>
-                    </if>
-                </catch>
-            </trycatch>
-        </sequential>
-    </macrodef>
-
     <!-- Macrodefinition launching JUnit test -->
     <macrodef name="run-junit-test">
         <attribute name="test"/>
@@ -151,14 +108,11 @@
         <sequential>
             <junit jvm="${test.jvm.exe}"
                    fork="yes"
-                   haltonfailure="false"
-                   haltonerror="${test.failfast}"
                    printsummary="withOutAndErr"
                    dir="${basedir}"
                    failureproperty="reg.test.errors"
                    timeout="${reg.test.timeout}">
-                <jvmarg value="-XX:-vm.assert_dialog" />
-                <jvmarg line="@{vmarg}"/>
+                <jvmarg line="@{vmarg} ${test.vmargs}"/>
                 <test name="@{test}" todir="${reg.test.dir}/reports"/>
                 <classpath>
                     <pathelement path="${reg.test.class.path}"/>
@@ -167,11 +121,18 @@
                 <formatter type="brief"/>
                 <formatter type="xml"/>
             </junit>
-            <fail message="${reg.test.failed.mark}">
+            
+            <if>
+                <istrue value="${reg.test.errors}"/>
+                <then>
+                    <echo message="*** FAILED **** : @{test}${line.separator}" file="${reg.test.summary}" append="true"/>
+                </then>
+            </if>
+            <fail message="@{test} failed">
                 <condition>
                     <and>
-                        <isset property="reg.test.custom.launched"/>
                         <istrue value="${reg.test.errors}"/>
+                        <istrue value="${test.failfast}"/>
                     </and>
                 </condition>
             </fail>
@@ -213,7 +174,7 @@
                   fork="yes"
                   timeout="${reg.test.timeout}">
                 <java-element/>
-                <jvmarg line="@{vmarg}" />
+                <jvmarg line="@{vmarg} ${test.vmargs}" />
                 <arg line="@{args}" />
                 <classpath>
                     <pathelement path="${reg.test.class.path}"/>
@@ -233,11 +194,17 @@
                 msg="Exit code: ${@{test}.res.code}"
                 detail="Exit code: ${@{test}.res.code} Err: ${@{test}.msg}"/>
 
+            <!-- handle test result -->
             <if>
                 <isfalse value="${@{test}.is.passed}"/>
                 <then>
                     <echo message="*** FAILED **** : @{test} (${@{test}.res.code} exit code)"/>
-                    <fail message="${reg.test.failed.mark}"/>
+                    <echo message="*** FAILED **** : @{test} (${@{test}.res.code} exit code)${line.separator}" file="${reg.test.summary}" append="true"/>
+                    <fail message="@{test} failed">
+                        <condition>
+                            <istrue value="${test.failfast}"/>
+                        </condition>
+                    </fail>
                 </then>
                 <else>
                     <echo message="PASSED : @{test}"/>

Modified: harmony/enhanced/drlvm/trunk/build/make/test.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/test.properties?rev=584742&r1=584741&r2=584742&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/test.properties (original)
+++ harmony/enhanced/drlvm/trunk/build/make/test.properties Mon Oct 15 04:28:22 2007
@@ -89,11 +89,11 @@
  
 eclipse.mirror=http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/eclipse/downloads/drops/R-3.2.1-200609210945
 eclipse-3.3.mirror=http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/eclipse/downloads/drops/R-3.3-200706251500
-eclipse.win.x86.url=${eclipse.mirror}/eclipse-SDK-3.2.1-win32.zip
-#eclipse.win.x86.url=${eclipse-3.3.mirror}/eclipse-SDK-3.3-win32.zip
-eclipse.win.x86_64.url=${eclipse.mirror}/eclipse-SDK-3.2.1-win32-x86_64.zip
-#eclipse.win.x86_64.url=${eclipse-3.3.mirror}/eclipse-SDK-3.3-win32-x86_64.zip
-eclipse.win.ia64.url=${eclipse.mirror}/eclipse-SDK-3.2.1-win32-ia64.zip
+eclipse.windows.x86.url=${eclipse.mirror}/eclipse-SDK-3.2.1-win32.zip
+#eclipse.windows.x86.url=${eclipse-3.3.mirror}/eclipse-SDK-3.3-win32.zip
+eclipse.windows.x86_64.url=${eclipse.mirror}/eclipse-SDK-3.2.1-win32-x86_64.zip
+#eclipse.windows.x86_64.url=${eclipse-3.3.mirror}/eclipse-SDK-3.3-win32-x86_64.zip
+eclipse.windows.ia64.url=${eclipse.mirror}/eclipse-SDK-3.2.1-win32-ia64.zip
 eclipse.linux.x86.url=${eclipse.mirror}/eclipse-SDK-3.2.1-linux-gtk.tar.gz
 eclipse.linux.x86_64.url=${eclipse.mirror}/eclipse-SDK-3.2.1-linux-gtk-x86_64.tar.gz
 eclipse.linux.ia64.url=${eclipse.mirror}/eclipse-SDK-3.2.1-linux-gtk-ia64.tar.gz