Bug 5833

Summary: Ant build does not properly set exit code on failure
Product: jbatch Reporter: chrisschaefer
Component: TCKAssignee: ScottKurz
Status: NEW ---    
Severity: major CC: issues
Priority: P5    
Version: 1   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS   
Whiteboard: suggestion

Description chrisschaefer 2014-02-27 18:50:08 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.