I'm running CrossCheck (browserless js unit testing) as part of an ant script. I'd like ant to report failure if the CrossCheck tests fail. Here's the relevant bit from the build.xml
<target name="test" depends="concat">
<java jar="src/test/lib/crosscheck.jar" fork="true">
<arg value="src/test/webapp/js/"/>
</java>
And an example of CrossCheck's failure messaging:
[java] Running tests in environment: Mozilla 1.7 (Firefox 1.0)
[java] org.mozilla.javascript.EcmaError: ReferenceError: "clusterNode" is not defined. (ResultXMLWrapperTest.js#22)
[java] at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3229)
[java] at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3219)
[java] at org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3292)
[java] at org.mozilla.javascript.ScriptRuntime.nameOrFunction(ScriptRuntime.java:1636)
[java] at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1575)
[java] at org.mozilla.javascript.gen.c1._c1(ResultXMLWrapperTest.js:22)
[java] at org.mozilla.javascript.gen.c1.call(ResultXMLWrapperTest.js)
[java] at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:340)
[java] at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2758)
[java] at org.mozilla.javascript.gen.c1.call(ResultXMLWrapperTest.js)
[java] at net.thefrontside.crosscheck.framework.AbstractScopeFactory$1.run(AbstractScopeFactory.java:108)
[java] at org.mozilla.javascript.Context.call(Context.java:515)
[java] at org.mozilla.javascript.Context.call(Context.java:450)
[java] at net.thefrontside.crosscheck.framework.AbstractScopeFactory.initTestScope(AbstractScopeFactory.java:94)
[java] at net.thefrontside.crosscheck.framework.DefaultScopeFactory.getTestScope(DefaultScopeFactory.java:68)
[java] at net.thefrontside.crosscheck.framework.TestCase$1.run(TestCase.java:119)
[java] at org.mozilla.javascript.Context.call(Context.java:528)
[java] at org.mozilla.javascript.Context.call(Context.java:450)
[java] at net.thefrontside.crosscheck.framework.TestCase.run(TestCase.java:117)
[java] at net.thefrontside.crosscheck.framework.TestSuite.run(TestSuite.java:95)
[java] at net.thefrontside.crosscheck.framework.Crosscheck.runAll(Crosscheck.java:116)
[java] at net.thefrontside.crosscheck.framework.ConsoleRunner.run(ConsoleRunner.java:140)
[java] at net.thefrontside.crosscheck.framework.ConsoleRunner.main(ConsoleRunner.java:300)
[java] ReferenceError: "clusterNode" is not defined. (ResultXMLWrapperTest.js#22)
[java] Java Result: 1
Can ant get at the results of the CrossCheck test (perhaps Java Result: 1 gets passed back to ant?) and succeed or fail based on that?