summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-05-14 18:50:02 +0000
committerRafael H. Schloming <rhs@apache.org>2008-05-14 18:50:02 +0000
commit81f7b4aaeede6a9eedbba4a7e2c2e2991ec48bd1 (patch)
tree5f99bb6e9148654125bd8437ccf88777b6bc5aa7
parent7ec5ed09424b8b75a907519889dafb609a13676a (diff)
downloadqpid-python-81f7b4aaeede6a9eedbba4a7e2c2e2991ec48bd1.tar.gz
QPID-965: made the ant build report the cummulative success/failure of the test suite
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@656357 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/build.xml14
-rw-r--r--qpid/java/common.xml1
-rw-r--r--qpid/java/module.xml28
3 files changed, 38 insertions, 5 deletions
diff --git a/qpid/java/build.xml b/qpid/java/build.xml
index 5a5db734f6..4f5f2fb246 100644
--- a/qpid/java/build.xml
+++ b/qpid/java/build.xml
@@ -63,7 +63,19 @@
</target>
<target name="test" description="execute tests">
- <iterate target="test"/>
+
+ <delete file="${build.failed}"/>
+
+ <iterate target="test">
+ <property name="test.failures.ignore" value="true"/>
+ </iterate>
+
+ <condition property="failed">
+ <available file="${build.failed}"/>
+ </condition>
+
+ <fail if="failed" message="TEST SUITE FAILED"/>
+
</target>
<target name="jar" description="create module jars">
diff --git a/qpid/java/common.xml b/qpid/java/common.xml
index 281d5d0b33..8d61880714 100644
--- a/qpid/java/common.xml
+++ b/qpid/java/common.xml
@@ -31,6 +31,7 @@
<property name="build.etc" location="${build}/etc"/>
<property name="build.lib" location="${build}/lib"/>
<property name="build.results" location="${build}/results"/>
+ <property name="build.failed" location="${build.results}/FAILED"/>
<property name="build.report" location="${build}/report"/>
<property name="build.release" location="${build}/release"/>
<property name="build.release.prepare" location="${build.release}/prepare"/>
diff --git a/qpid/java/module.xml b/qpid/java/module.xml
index 44d2a8ee6c..42385e3f53 100644
--- a/qpid/java/module.xml
+++ b/qpid/java/module.xml
@@ -35,6 +35,8 @@
<property name="module.precompiled" location="${module.build}/src"/>
<property name="module.api" location="${module.build}/api"/>
<property name="module.test.classes" location="${module.build}/test/classes"/>
+ <property name="module.results" location="${build.results}/${module}"/>
+ <property name="module.failed" location="${module.results}/FAILED"/>
<property name="module.src" location="src/main/java"/>
<property name="module.test.src" location="src/test/java"/>
<property name="module.bin" location="bin"/>
@@ -128,13 +130,13 @@
<mkdir dir="${build.etc}"/>
<mkdir dir="${build.lib}"/>
<mkdir dir="${build.results}"/>
- <mkdir dir="${build.results}/${module.name}"/>
<mkdir dir="${build.data}"/>
<mkdir dir="${build.plugins}"/>
<mkdir dir="${module.classes}"/>
<mkdir dir="${module.precompiled}"/>
<mkdir dir="${module.api}"/>
<mkdir dir="${module.test.classes}"/>
+ <mkdir dir="${module.results}"/>
</target>
<target name="precompile"/>
@@ -195,9 +197,11 @@
<target name="test" depends="build,compile-tests" if="module.test.src.exists"
unless="${dontruntest}" description="execute unit tests">
+ <delete file="${module.failed}"/>
+
<junit fork="${test.fork}" maxmemory="${test.mem}" reloading="no"
haltonfailure="${haltonfailure}" haltonerror="${haltonerror}"
- printsummary="on" timeout="600000" >
+ failureproperty="test.failures" printsummary="on" timeout="600000" >
<sysproperty key="amqj.logging.level" value="${amqj.logging.level}"/>
<sysproperty key="root.logging.level" value="${root.logging.level}"/>
@@ -220,14 +224,30 @@
<classpath refid="module.test.path"/>
- <batchtest fork="${test.fork}" todir="${build.results}/${module.name}">
+ <batchtest fork="${test.fork}" todir="${module.results}">
<fileset dir="${module.test.src}" excludes="${module.test.excludes}">
<include name="**/${test}.java"/>
</fileset>
</batchtest>
</junit>
+
+ <antcall target="touch-failed"/>
+
+ <condition property="failed">
+ <and>
+ <isfalse value="${test.failures.ignore}"/>
+ <available file="${module.failed}"/>
+ </and>
+ </condition>
+
+ <fail if="failed" message="TEST SUITE FAILED"/>
+
</target>
+ <target name="touch-failed" if="test.failures">
+ <touch file="${module.failed}"/>
+ <touch file="${build.failed}"/>
+ </target>
<target name="copy-bin" if="module.bin.exists" description="copy bin directory if it exists to build tree">
<copy todir="${build.bin}" failonerror="false">
@@ -274,7 +294,7 @@
<target name="clean" description="remove build artifacts">
<delete dir="${module.build}"/>
- <delete dir="${build.results}/${module.name}"/>
+ <delete dir="${module.results}"/>
</target>
</project>