Bugzilla – Bug 5833
Ant build does not properly set exit code on failure
Last modified: 2015-09-03 14:14:24 UTC
When running "ant" in the TCK home directory, if a TCK tests fails or some other test configuration error occurs (say a missing jar from classpath), the ant build will indicate from testng that there was some sort of failure but ant will exit in BUILD SUCCESS. The process will also report an exit code of 0.
If a failure of some sort occurs, it should be reported as so and a non 0 exit code should be returned.
A simple fix to build.xml that I have found is adding the following after </testng> and before </target>:
<fail if="tests.failed" message="JSR-352 TCK TESTS FAILED"/>
This should be fixed so running the TCK can be integrated into other build tools and accurately determine if the test suite was successful.
This has been added to the master branch using:
<testng ... haltonfailure="true"