JAVA build: Changing the build file to make it more obvious when tests fail and print...
authorlararennie@google.com <lararennie@google.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Mon, 2 Jul 2012 12:28:02 +0000 (12:28 +0000)
committerlararennie@google.com <lararennie@google.com@ee073f10-1060-11df-b6a4-87a95322a99c>
Mon, 2 Jul 2012 12:28:02 +0000 (12:28 +0000)
git-svn-id: http://libphonenumber.googlecode.com/svn/trunk@483 ee073f10-1060-11df-b6a4-87a95322a99c

java/build.xml

index 150753d..7594634 100644 (file)
 
   <target name="junit" depends="test-jar">
     <mkdir dir="${report.dir}"/>
-    <junit printsummary="yes">
+    <junit printsummary="yes"
+        failureProperty="test.failed" errorProperty="test.failed">
       <classpath refid="test.classpath"/>
       <formatter type="xml"/>
       <batchtest fork="no" todir="${report.dir}">
         <fileset dir="${geocoder.test.dir}" includes="**/*Test.java"/>
       </batchtest>
     </junit>
+    <fail message="Tests failed. Run 'ant junitreport' for more info."
+        if="test.failed"/>
   </target>
 
   <target name="junitreport">