vmassol 2003/03/23 07:23:45
Modified: integration/ant/src/scripts/share build-share.xml
Log:
- Added support for report generation
- Added support for stopping the build on failure/error (or continuing)
Revision Changes Path
1.8 +54 -7 jakarta-cactus/integration/ant/src/scripts/share/build-share.xml
Index: build-share.xml
===================================================================
RCS file:
/home/cvs/jakarta-cactus/integration/ant/src/scripts/share/build-share.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- build-share.xml 22 Mar 2003 10:30:30 -0000 1.7
+++ build-share.xml 23 Mar 2003 15:23:45 -0000 1.8
@@ -19,7 +19,19 @@
<!-- Default webapp context -->
<property name="cactus.context" value="cactustest"/>
-
+
+ <!-- Decides whether the test result will be printed to the console or
+ not. Default is true -->
+ <property name="cactus.junit.usefile" value="false"/>
+
+ <!-- Location of junit test reports for the Cactus tests -->
+ <property name="cactus.reports.dir"
+ value="${cactus.target.dir}/test-cactus-reports"/>
+
+ <!-- Decides whether to halt the build on error and/or on failure -->
+ <property name="cactus.halt.on.failure" value="true"/>
+ <property name="cactus.halt.on.error" value="true"/>
+
<!--
========================================================================
Set the properties related to the source tree.
@@ -174,8 +186,11 @@
<copy tofile="${cactus.target.conf.dir}/log4j.properties"
file="${cactus.conf.dir}/log_client.properties"/>
- <junit printsummary="yes" haltonfailure="yes" haltonerror="yes"
- fork="yes">
+ <!-- Create the test report directory before running the tests -->
+ <mkdir dir="${cactus.reports.dir}"/>
+
+ <junit printsummary="yes" failureproperty="cactus.junit.failure"
+ errorproperty="cactus.junit.error" fork="yes">
<jvmarg
value="-Dcactus.contextURL=http://localhost:${cactus.port}/${cactus.context}"/>
@@ -198,11 +213,12 @@
<path refid="cactus.classpath"/>
</classpath>
- <formatter type="plain" usefile="false"/>
+ <formatter type="xml"/>
+ <formatter type="plain" usefile="${cactus.junit.usefile}"/>
<!-- TODO: Automatically discover Cactus tests -->
- <batchtest>
+ <batchtest todir="${cactus.reports.dir}">
<fileset dir="${cactus.src.dir}"
includes="${cactus.src.includes}"
excludes="${cactus.src.excludes}"/>
@@ -210,14 +226,45 @@
</junit>
+ <!-- Decides whether to halt the build if errors or failures have
+ occurred -->
+
+ <condition property="cactus.test.error.shouldstop">
+ <and>
+ <isset property="cactus.junit.error"/>
+ <equals arg1="${cactus.halt.on.error}" arg2="true" trim="true"
+ casesensitive="false"/>
+ </and>
+ </condition>
+ <antcall target="cactus.test.check.error"/>
+
+ <condition property="cactus.test.failure.shouldstop">
+ <and>
+ <isset property="cactus.junit.failure"/>
+ <equals arg1="${cactus.halt.on.failure}" arg2="true" trim="true"
+ casesensitive="false"/>
+ </and>
+ </condition>
+ <antcall target="cactus.test.check.failure"/>
+
+ </target>
+
+ <target name="cactus.test.check.error" if="cactus.test.error.shouldstop">
+ <fail>There were test errors</fail>
+ </target>
+
+ <target name="cactus.test.check.failure"
+ if="cactus.test.failure.shouldstop">
+ <fail>There were test failures</fail>
</target>
-
+
<!--
========================================================================
Clean generated files (including distributables)
========================================================================
-->
- <target name="cactus.clean" depends="cactus.init" description="Clean target
directory">
+ <target name="cactus.clean" depends="cactus.init"
+ description="Clean target directory">
<delete includeEmptyDirs="true">
<fileset dir="${cactus.target.dir}/${cactus.context}"/>
</delete>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]