Evaluating a JUnit XML file created outside Gradle

I have a JUnit XML file that is produced by CasperJS, can I get Gradle to evaluate this file and fail a task based on the results?

You’ll have to write a Gradle task that parses the XML. With Groovy’s ‘XmlSlurper’, this is fairly easy to do (once you get the hang of it).

Ok, thanks a lot.

By the way, does the Gradle test task currently evaluate the test results by parsing the XML?

No, the Gradle test task generates the XML. (Contrary to common belief, JUnit itself doesn’t know anything about XML/HTML reports.)

I see, thanks for clearing up that misconception.