Author: vgritsenko
Date: Wed Oct 27 12:22:01 2004
New Revision: 55725

Modified:
   cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl
   cocoon/branches/BRANCH_2_1_X/tools/targets/test-build.xml
Log:
Rearrange test targets.
"test" runs *all* tests, "junit-tests" runs JUnit,
and "anteater-tests" ... well, you guessed it right.


Modified: cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl     (original)
+++ cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl     Wed Oct 27 
12:22:01 2004
@@ -641,7 +641,6 @@
       </if>
     </target>
     <target name="[EMAIL PROTECTED]" 
unless="internal.exclude.block.{$block-name}">
-
       <!-- Test if this block has Anteater tests -->
       <if>
         <available file="${{blocks}}/{$block-name}/test/anteater"/>

Modified: cocoon/branches/BRANCH_2_1_X/tools/targets/test-build.xml
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/tools/targets/test-build.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/tools/targets/test-build.xml   Wed Oct 27 
12:22:01 2004
@@ -15,24 +15,28 @@
   limitations under the License.
 -->
 <project name="test">
-
   <description>Test targets</description>
 
   <!--+
-      | JUnit tests
+      | Runs all tests
+      +-->
+  <target name="test" depends="junit-tests, anteater-tests"
+          description="Runs all tests"/>
+
+  <!--+
+      | Runs JUnit tests
       +-->
 
-  <!-- Runs all tests -->
-  <target name="test" depends="junit-tests, block-tests" 
-          description="Runs all JUnit tests (but no anteater tests)"/>
+  <target name="junit-tests" depends="core-junit-tests, block-junit-tests, 
junit-tests-report"
+          description="Runs JUnit tests"/>
 
-  <target name="junit-prepare">
+  <target name="junit-tests-prepare">
     <delete dir="${build.test.output}"/>
     <mkdir dir="${build.test.output}"/>
   </target>
 
   <!-- Runs JUnit tests -->
-  <target name="junit-tests" depends="compile-tests, junit-prepare">
+  <target name="core-junit-tests" depends="compile-tests, junit-tests-prepare">
     <junit printsummary="yes" fork="yes" failureproperty="junit.test.failed">
       <classpath>
         <path refid="test.classpath"/>
@@ -52,11 +56,10 @@
         </fileset>
       </batchtest>
     </junit>
-    <antcall target="junit-report"/>
   </target>
 
   <!-- Runs JUnit tests in debug mode -->
-  <target name="junit-test-debug" depends="compile-tests, junit-prepare">
+  <target name="junit-test-debug" depends="compile-tests, junit-tests-prepare">
     <fail unless="junit.testcase" 
           message="Please set the property $${junit.testcase} to a JUnit 
testcase (package.Classname, e.g. org.test.MyTestCase)."/>
 
@@ -69,10 +72,17 @@
       <formatter type="xml"/>
       <test name="${junit.testcase}" todir="${build.test.output}"/>
     </junit>
-    <antcall target="junit-report"/>
   </target>
 
-  <target name="junit-report">
+  <!-- Block tests -->
+  <target name="block-junit-tests" depends="compile-tests, prepare-blocks">
+    <ant antfile="${build.temp}/blocks-build.xml"
+         inheritAll="true"
+         inheritRefs="false"
+         target="tests"/>
+  </target>      
+  
+  <target name="junit-tests-report">
     <junitreport todir="${build.test.output}">
       <fileset dir="${build.test.output}">
        <include name="TEST-*.xml"/>
@@ -80,21 +90,19 @@
       <report format="frames" todir="${build.test.output}"/>
     </junitreport>
     <echo message="Unit report is at ${build.test.output}/index.html"/>
-    <fail if="junit.test.failed" message="One or more JUnit tests failed or 
caused errors. Please have a look into the report for details."/>
+    <fail if="junit.test.failed"
+          message="One or more JUnit tests failed or caused errors. Please 
have a look into the report for details."/>
   </target>
 
-  <!-- Block tests -->
-  <target name="block-tests" depends="compile-tests, prepare-blocks">
-    <ant antfile="${build.temp}/blocks-build.xml"
-         inheritAll="true"
-         inheritRefs="false"
-         target="tests"/>
-  </target>      
-  
+
   <!--+
       | Anteater tests
       +-->
       
+  <!-- Anteater tests  -->
+  <target name="anteater-tests" depends="block-anteater-tests, 
core-anteater-tests"
+          description="Runs AntEater tests"/>
+
   <!-- Ant macro that calls anteater -->
   <macrodef name="call-anteater">
     <attribute name="script"/>
@@ -119,41 +127,31 @@
     </sequential>
   </macrodef>
       
-  <!-- check whether Anteater is installed and available -->
-  <macrodef name="check-anteater">
-    <sequential>
-      <!-- anteater parameters are set in build.properties -->
-      <available file="${anteater.home}" property="anteater.present"/>
-      <fail unless="anteater.present"
-            message="To use anteater, please install it and set anteater.home 
(currently ${anteater.home}) in your local.build.properties"/>          
-    </sequential>
-  </macrodef>
-
-  <macrodef name="anteater-notes">
-    <sequential>
-      <echo>*** Anteater notes ***</echo>
-      <echo>a) To run these tests, another instance of Cocoon must be</echo>
-      <echo>   running at ${anteater.target.host}:${anteater.target.port} 
(base path=${anteater.target.base.path})</echo>
-      <echo>b) JDK 1.4.x is required to run these tests, but running 
them</echo>
-      <echo>   under 1.4.x to test Cocoon running under 1.3.x should be 
ok.</echo>
-      <echo>c) anteater options can be set in local.build.properties, and 
some</echo>
-      <echo>   tests only run if enabled there.</echo>
-    </sequential> 
-  </macrodef>
+  <target name="anteater-tests-prepare">
+    <!-- check whether Anteater is installed and available -->
+    <!-- anteater parameters are set in build.properties -->
+    <available file="${anteater.home}" property="anteater.present"/>
+    <fail unless="anteater.present"
+          message="To use anteater, please install it and set anteater.home 
(currently ${anteater.home}) in your local.build.properties"/>
+
+    <echo>*** Anteater notes ***</echo>
+    <echo>a) To run these tests, another instance of Cocoon must be</echo>
+    <echo>   running at ${anteater.target.host}:${anteater.target.port} (base 
path=${anteater.target.base.path})</echo>
+    <echo>b) JDK 1.4.x is required to run these tests, but running them</echo>
+    <echo>   under 1.4.x to test Cocoon running under 1.3.x should be 
ok.</echo>
+    <echo>c) anteater options can be set in local.build.properties, and 
some</echo>
+    <echo>   tests only run if enabled there.</echo>
+  </target>
 
   <!-- Anteater tests  -->
-  <target name="anteater-tests" depends="compile-tests,block-anteater-tests" 
-          description="Runs anteater tests (but no JUnit tests)">
-    <check-anteater/>
-    <anteater-notes/>
+  <target name="core-anteater-tests" depends="compile-tests, 
anteater-tests-prepare"
+          description="Runs anteater tests">
     <call-anteater script="run-tests.xml" target="all" targetfile=""/>
   </target>
 
-  <!-- Run a SINGLE Anteater tests  -->
-  <target name="anteater-test" depends="compile-tests,block-anteater-tests" 
+  <!-- Run a SINGLE Anteater tests -->
+  <target name="anteater-test" depends="compile-tests, anteater-tests-prepare, 
block-anteater-tests"
           description="Runs a single Anteater test">
-    <check-anteater/>
-    <anteater-notes/>
     <echo>d) to run the tests in 'calc.xml' call 'build anteater-test 
-Dtarget=calc'</echo>
     <call-anteater script="run-tests.xml" target="single" 
targetfile="${target}"/>
   </target>
@@ -165,5 +163,4 @@
          inheritRefs="false"
          target="prepare-anteater-tests"/>
   </target>
-
 </project>

Reply via email to