You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by sm...@apache.org on 2007/05/29 08:09:04 UTC

svn commit: r542419 - in /harmony/enhanced/buildtest/branches/2.0/scripts: cc-exec-adaptor.xml cc-project.xml framework.properties framework.xml

Author: smishura
Date: Mon May 28 23:09:03 2007
New Revision: 542419

URL: http://svn.apache.org/viewvc?view=rev&rev=542419
Log:
Apply patch from HARMONY-3501 for CC tests execution

Modified:
    harmony/enhanced/buildtest/branches/2.0/scripts/cc-exec-adaptor.xml
    harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml
    harmony/enhanced/buildtest/branches/2.0/scripts/framework.properties
    harmony/enhanced/buildtest/branches/2.0/scripts/framework.xml

Modified: harmony/enhanced/buildtest/branches/2.0/scripts/cc-exec-adaptor.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/cc-exec-adaptor.xml?view=diff&rev=542419&r1=542418&r2=542419
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/cc-exec-adaptor.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/cc-exec-adaptor.xml Mon May 28 23:09:03 2007
@@ -24,20 +24,78 @@
     <property file="${framework.properties.file}"/>
     <import file="${framework.implementation.file}"/>
 
+    <property name="suite.adaptor.dir" 
+              value="${root.dir}/adaptors/${suite.name}"/>
+    
+    <!-- load test suites execution statuses -->
+    <property file="${cc.execution.status.file}"/>
+
+    <property name="suite.adaptor.dir" 
+              value="${root.dir}/adaptors/${suite.name}"/>
+    
     <!-- Called from CC to launch the test suite named ${test.suite} -->
     <target name="cc-run" depends="define-ant-contrib">
-        <property name="suite.adaptor.dir" value="${root.dir}/adaptors/${suite.name}"/>
         <log message="Test Suite '${suite.name}' execution. Repository updated: ${repository.updated}"/>
-        <ant dir="${root.dir}/adaptors/${suite.name}" 
-             antfile="adaptor.xml" 
-             target="run"
-             inheritAll="true"/>
+
+        <!-- clear previous status -->
+        <replaceregexp file="${cc.execution.status.file}"
+                       match="^${suite.name}\.parameters\..*\n"
+                       replace=""
+                       byline="true"/>
+
+        <check-superior-failures
+            suite="${suite.name}"
+            check-target="run"
+            property="failed.superiors"
+        />
+        <if>
+            <isset property="failed.superiors"/>
+        <then>
+            <!-- write 'skipped' status -->
+            <propertyfile file="${cc.execution.status.file}"
+                          comment="${cc.execution.status.file.header}.">
+                <entry key="${suite.name}.parameters.run.skipped" value="true"/>
+            </propertyfile>
+            <echo level="warning">
+Test Suite '${suite.name}' was not executed (SKIPPED) 
+as the following preceding suites on which '${suite.name}' depends upon
+failed to run or have been skipped:
+    ${failed.superiors}
+</echo>
+            <fail message="Execution SKIPPED (failed superiors: ${failed.superiors})."/>
+
+        </then>
+        </if>
+
+        <trycatch property="exception" reference="execution.exception.ref">
+        <try>
+            <ant dir="${root.dir}/adaptors/${suite.name}" 
+                 antfile="adaptor.xml" 
+                 target="run"
+                 inheritAll="true"/>
+        </try>
+        <catch>
+            <echo>
+Test Suite '${suite.name}' Execution FAILED with the following exception:
+${exception}
+</echo>
+            <!-- write 'failed' status -->
+            <propertyfile file="${cc.execution.status.file}"
+                          comment="${cc.execution.status.file.header}.">
+                <entry key="${suite.name}.parameters.run.failed" value="true"/>
+            </propertyfile>
+        </catch>
+        </trycatch>
+        <fail message="${exception}" if="exception"/>
     </target>
 
     <!-- Called from CC to launch the custom ant publisher for test suite -->
+    <!-- Does nothing if the execution has been skipped (due to failures
+         of preceding suites) -->
     <target name="cc-publish-custom" 
             depends="define-ant-contrib"
-            if="framework.parameters.usemail">
+            if="framework.parameters.usemail" 
+            unless="${suite.name}.parameters.run.skipped">
         <dirname property="publisher.dir" file="${publisher.location}"/>
         <log message="Calling Custom Publisher ${publisher.location} at ${publisher.dir} for ${suite.name}"/>
         <ant dir="${publisher.dir}" 
@@ -49,7 +107,8 @@
     <!-- Called from CC to launch the default ant publisher for test suite -->
     <target name="cc-publish" 
             depends="define-ant-contrib"
-            if="framework.parameters.usemail">
+            if="framework.parameters.usemail"
+            unless="${suite.name}.parameters.run.skipped">
 
         <!-- set up mail message file (if it was defined by test suite) -->
         <get-parameter-value

Modified: harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml?view=diff&rev=542419&r1=542418&r2=542419
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/cc-project.xml Mon May 28 23:09:03 2007
@@ -36,8 +36,9 @@
             </delete>
         </then>
         </if>
-        <mkdir dir="${build.dir}/cc"/>
+        <mkdir dir="${cc.work.dir}"/>
         <mkdir dir="${cc.log.dir}"/>
+        <touch file="${cc.execution.status.file}"/>
         </sequential>
     </target>
     

Modified: harmony/enhanced/buildtest/branches/2.0/scripts/framework.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/framework.properties?view=diff&rev=542419&r1=542418&r2=542419
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/framework.properties (original)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/framework.properties Mon May 28 23:09:03 2007
@@ -19,6 +19,8 @@
 cc.project.template=${scripts.dir}/templates/cc-project-template.xml
 cc.log.dir=${cc.work.dir}/logs
 cc.project.execution.timeout=5000000
+cc.execution.status.file=${cc.work.dir}/execution.status
+cc.execution.status.file.header=\ Autogenerated file used for Test Suites execution status checking.
 
 local.configuration.file=${root.dir}/framework.local.properties
 local.configuration.template.file=${scripts.dir}/local.properties.template

Modified: harmony/enhanced/buildtest/branches/2.0/scripts/framework.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/scripts/framework.xml?view=diff&rev=542419&r1=542418&r2=542419
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/scripts/framework.xml (original)
+++ harmony/enhanced/buildtest/branches/2.0/scripts/framework.xml Mon May 28 23:09:03 2007
@@ -454,17 +454,11 @@
             <echo>===========================================</echo>
             <echo>Setup of '@{suite}' Test Suite..</echo>
             <!-- check for the failures of the superior suites -->
-            <for list="${@{suite}.parameters.depends}" param="superior">
-            <sequential>
-                <log message="Check for setup failure of @{superior} = ${@{superior}.parameters.run.failed}"/>
-                <condition property="@{suite}.has.failed.superior">
-                    <or>
-                        <isset property="@{superior}.parameters.setup.failed"/>
-                        <isset property="@{superior}.parameters.setup.skipped"/>
-                    </or>
-                </condition>
-            </sequential>
-            </for>
+            <check-superior-failures
+                suite="@{suite}"
+                check-target="setup"
+                property="@{suite}.has.failed.superior"
+            />
             <if>
                 <isset property="@{suite}.has.failed.superior"/>
             <then>
@@ -506,17 +500,11 @@
             </then>
             <else>
                 <!-- check for the failures of the superior suites -->
-                <for list="${@{suite}.parameters.depends}" param="superior">
-                <sequential>
-                    <log message="Check for failure of @{superior} = ${@{superior}.parameters.run.failed}"/>
-                    <condition property="@{suite}.has.failed.superior">
-                        <or>
-                            <isset property="@{superior}.parameters.run.failed"/>
-                            <isset property="@{superior}.parameters.run.skipped"/>
-                        </or>
-                    </condition>
-                </sequential>
-                </for>
+                <check-superior-failures
+                    suite="@{suite}"
+                    check-target="run"
+                    property="@{suite}.has.failed.superior"
+                />
                 <if>
                     <isset property="@{suite}.has.failed.superior"/>
                 <then>
@@ -818,6 +806,35 @@
         <fail message="There are Test Suites failures" if="has.failure"/>
     </target>
 
+    <!-- check for the failures of the superior suites and place their
+         names (if any) into specified property -->
+    <macrodef name="check-superior-failures">
+        <attribute name="suite"/>
+        <attribute name="check-target"/>
+        <attribute name="property" default="@{suite}.has.failed.superior"/>
+        <sequential>
+            <var name="@{property}" unset="true"/>
+
+            <for list="${@{suite}.parameters.depends}" param="superior">
+            <sequential>
+                <log message="Check for '@{check-target}' failure of @{superior} = ${@{superior}.parameters.@{check-target}.failed}"/>
+                <if>
+                    <or>
+                        <istrue value="${@{superior}.parameters.@{check-target}.failed}"/>
+                        <istrue value="${@{superior}.parameters.@{check-target}.skipped}"/>
+                    </or>
+                <then>
+                    <!-- empty value as initial -->
+                    <property name="@{property}" value=""/>
+                    <var name="@{property}" value="${@{property}}@{superior} "/>
+                </then>
+                </if>
+            </sequential>
+            </for>
+            <log message="Result: @{property} = '${@{property}}'"/>
+        </sequential>
+    </macrodef>
+
     <!-- removes svn locks leaved after unsuccessful checkout or update-->
     <macrodef name="svn-cleanup">
         <attribute name="trunk"/>
@@ -919,7 +936,7 @@
             <if>
                 <istrue value="${framework.parameters.optional.dolog}"/>
             <then>
-                <echo level="debug">[${ant.project.name}]: @{message}</echo>
+                <echo level="warning">[${ant.project.name}]: @{message}</echo>
             </then>
             </if>
         </sequential>