All because you didn't know how to do this . In ant on *nix , you can easily just grep for the failures in your test reports directory. This is because the Junitreport task will WRITE OUT ALL RESULTS TO XML FILES for you.
This quick little grep might save you alot of time if you want to know, without eye-grepping, how many tests failed.
<em><!-- Capture all failures, simple debugging statements. -->
<junitreport>
<fileset dir="${reports.dir}/tmp">
<include name="*.xml" />
</fileset>
<report todir="${reports.dir}/final" />
</junitreport>
<echo message="... Scanning for any failed MY_APP_NAME junit tests... "/>
<exec executable="grep">
<arg value="-r" />
<arg value="-m" />
<arg value="1" />
<arg value="-rl" />
<arg value="errors=\"[1-9]\"" />
<arg value="${reports.dir}" />
</exec>
<echo message="...DONE Grepping for failures/errors outputs : "/>
<fail if="junit.failed" message="FAILING - unit tests failed." /></em>
No comments:
Post a Comment