Repository: zookeeper
Updated Branches:
  refs/heads/master 26aee2228 -> ee5615d31


ZOOKEEPER-2682: Make it optional to fail build on test failure

Author: Mohammad Arshad <[email protected]>

Reviewers: Rakesh Radhakrishnan <[email protected]>

Closes #163 from arshadmohammad/ZOOKEEPER-2682-master-branch-3.5


Project: http://git-wip-us.apache.org/repos/asf/zookeeper/repo
Commit: http://git-wip-us.apache.org/repos/asf/zookeeper/commit/ee5615d3
Tree: http://git-wip-us.apache.org/repos/asf/zookeeper/tree/ee5615d3
Diff: http://git-wip-us.apache.org/repos/asf/zookeeper/diff/ee5615d3

Branch: refs/heads/master
Commit: ee5615d31ff4da2b2111f5a3b5d5b650f60bf936
Parents: 26aee22
Author: Mohammad Arshad <[email protected]>
Authored: Tue Feb 7 13:23:26 2017 +0530
Committer: Rakesh Radhakrishnan <[email protected]>
Committed: Tue Feb 7 13:23:26 2017 +0530

----------------------------------------------------------------------
 build.xml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zookeeper/blob/ee5615d3/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 1937e5b..e256fa5 100644
--- a/build.xml
+++ b/build.xml
@@ -89,6 +89,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
     <property name="test.junit.threads" value="1" />
     <property name="test.junit.printsummary" value="yes" />
     <property name="test.junit.haltonfailure" value="no" />
+    <property name="test.junit.failbuild.ontestfailure" value="true" />
     <property name="config.dir" value="${src.dir}/java/test/config" />
     <property name="test.junit.maxmem" value="512m" />
     <property name="test.quick" value="no" />
@@ -1208,6 +1209,10 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
             <fileset refid="testcase.files" />
           </batchtest>
         </junit>
+        <antcall target="fail.build.on.test.failure"/>
+    </target>
+
+    <target name="fail.build.on.test.failure" 
if="${test.junit.failbuild.ontestfailure}" >
         <fail if="tests.failed">Tests failed!</fail>
     </target>
 
@@ -1234,7 +1239,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
             <fileset refid="testcase.files" />
           </batchtest>
         </junit>
-        <fail if="tests.failed">Tests failed!</fail>
+        <antcall target="fail.build.on.test.failure"/>
     </target>
 
     <target name="check-cppunit-configure" depends="init" >
@@ -1477,7 +1482,7 @@ xmlns:cs="antlib:com.puppycrawl.tools.checkstyle.ant">
                 <fileset dir="${test.src.dir}" includes="**/${testcase}.java"/>
             </batchtest>
         </junit>
-        <fail if="tests.failed">Tests failed!</fail>
+        <antcall target="fail.build.on.test.failure"/>
     </target>
 
     <target name="cobertura-report" depends="cobertura-test">

Reply via email to