XML AntUnit Listener

Description

Writes reports similar to the "xml" JUnit formatter. Some information that appears as attributes for the JUnit formatter has been turned into elements to allow streaming of the report.

The AntUnit distribution comes with two XSLT stylesheets (in the etc subdirectory of the binary or the src/etc directory of the source release) that can be used together with Ant's <junitreport> task to create reports about your AntUnit tests.

Parameters

Attribute Description Required
toDir Directory where testreports will be written to. Defaults to the project's basedir. No.
logLevel Log level for messages from the tests to include in the report. Must be one of: none, error, warn, warning, info, verbose, and debug. Messages at the given level or below will be included. No. Default is 'none'.

Examples

    <au:antunit failonerror="false" errorproperty="antunit-failure">
      <fileset dir="${tests}" includes="*.xml"/>
      <au:xmllistener toDir="${reportsdir}"/>
    </au:antunit>
    <junitreport>
      <fileset dir="${reportsdir}" includes="*.xml"/>
      <report format="frames" styledir="${antunit-styles}"
              todir="${reportsdir}-frames"/>
    </junitreport>
    <fail if="antunit-failure">At least one test has failed</fail>

Runs AntUnit on all XML files in the directory ${tests} writing XML reports to the directory ${reportsdir} (which must exist upfront). Based on the XML reports a consolidated HTML frame report is created in ${reportsdir}-frames using the stylesheets mentioned above. ${antunit-styles} must point to the directory containing the stylesheets.