[jboss-cvs] JBoss Messaging SVN: r4668 - trunk.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jul 8 12:22:47 EDT 2008


Author: clebert.suconic at jboss.com
Date: 2008-07-08 12:22:47 -0400 (Tue, 08 Jul 2008)
New Revision: 4668

Modified:
   trunk/build-messaging.xml
Log:
unit-tests failure will now throw a BUILD FAILED message

Modified: trunk/build-messaging.xml
===================================================================
--- trunk/build-messaging.xml	2008-07-08 07:44:37 UTC (rev 4667)
+++ trunk/build-messaging.xml	2008-07-08 16:22:47 UTC (rev 4668)
@@ -647,9 +647,11 @@
    <target name="unit-tests" depends="jar, compile-unit-tests">
       <antcall inheritall="true" inheritrefs="true" target="tests">
          <param name="tests.param" value="**/org/jboss/messaging/tests/unit/**/*${test-mask}.class"/>
+      	 <!-- if tests.validate.error is defined, it will fail the build in case of any test failure -->
+      	 <param name="tests.validate.error" value="Defined!"/>
       </antcall>
    </target>
-
+	
    <target name="timing-tests" depends="jar, compile-unit-tests">
       <antcall inheritall="true" inheritrefs="true" target="tests">
          <param name="tests.param" value="**/org/jboss/messaging/tests/timing/**/*${test-mask}.class"/>
@@ -680,15 +682,28 @@
          <formatter type="xml" usefile="${junit.formatter.usefile}"/>
          <batchtest todir="${junit.batchtest.todir}"
                     haltonfailure="${junit.batchtest.haltonfailure}"
-                    haltonerror="${junit.batchtest.haltonerror}">
+                    haltonerror="${junit.batchtest.haltonerror}"
+         	        failureproperty="tests.failed">
             <formatter type="plain" usefile="${junit.formatter.usefile}"/>
             <fileset dir="${test.classes.dir}">
                <include name="${tests.param}"/>
             </fileset>
          </batchtest>
       </junit>
+   	  <antcall target="tests-validate-error" inheritall="true" inheritrefs="true"/>
    </target>
 
+   <!-- ifs on ant are convoluted by definition... this will throw a BUILD FAILED if tests.validate.error was defined and if a error (tests.failed) happened -->
+   <target name="tests-validate-error" if="tests.validate.error">
+     <antcall target="tests-onerror"  inheritall="true" inheritrefs="true"/>
+   </target>
+	
+   <!-- ifs on ant are convoluted by definition... this will throw a BUILD FAILED if tests.validate.error was defined and if a error (tests.failed) happened -->
+   <target name="tests-onerror" if="tests.failed">
+   	 <antcall target="compile-reports"/>
+   	 <fail message="Test suite failed!"/>
+   </target>
+
    <target name="jms-tests" depends="jar, compile-jms-tests">
       <echo message=""/>
       <echo message="Running jms tests, fork=${junit.fork}, junit.batchtest.fork=${junit.batchtest.fork}"/>
@@ -799,7 +814,7 @@
       <echo message="${test.execution.classpath.unix}" file="${test.execution.classpath.file}"/>
    </target>
 
-   <target name="emma" depends="compile, compile-unit-tests">
+   <target name="emma" depends="jar, compile-unit-tests">
       <property name="emma.dir" location="${build.dir}/emma"/>
 
       <path id="emma.lib">




More information about the jboss-cvs-commits mailing list