Merge the individual XML files generated by the JUnit task and eventually apply a
stylesheet on the resulting merged document to provide a browsable report of the testcases
results.
Note: This task depends on external libraries not included in the Apache Ant distribution. See Library Dependencies for more information.
| Attribute | Description | Required | 
|---|---|---|
| tofile | The name of the XML file that will aggregate all individual XML testsuites previously
      generated by the JUnittask. | No; defaults to TESTS-TestSuites.xml | 
| todir | The directory where the file resulting from the individual XML testsuite aggregation should be written. | No; defaults to current directory | 
junitreport collects individual xml files generated by the JUnit task
using the nested <FileSet> element.
Generate a browsable report based on the document created by the merge.
| Attribute | Description | Required | 
|---|---|---|
| format | The format of the generated report. Must be either noframesor frames. | No; defaults to frames | 
| styledir | The directory where the stylesheets are defined. They must be conforming to the following
      conventions: 
 | No; defaults to embedded stylesheets | 
| todir | The directory where the files resulting from the transformation should be written to. | No; defaults to current directory | 
Ant assumes the following concerning the frames
 and noframes
 formats:
framesformat uses a stylesheet which is generating output only by redirecting.
noframesformat does not use redirecting and generates one file called junit-noframes.html.
Custom versions of junit-frames.xsl or junit-noframes.xsl must adhere to the above conventions.
Since Ant 1.7, the report tag supports nested param tags.  These
tags can pass XSL parameters to the stylesheet.
| Attribute | Description | Required | 
|---|---|---|
| name | Name of the XSL parameter | Yes | 
| expression | Text value to be placed into the param.Was originally intended to be an XSL expression. | Yes | 
| if | The paramwill only be passed if this
      property is set. | No | 
| unless | The paramwill not be passed if this
      property is set. | No | 
The built-in stylesheets support the following parameters:
| XSL Parameter | Description | Required | 
|---|---|---|
| TITLE | Title used in <title>and<h1>tags | No; defaults to Unit Test Results | 
Since Ant 1.9.5. Like for the XSLT task, a
nested <classpath> will be used to load the processor.
Since Ant 1.9.5. Like for the XSLT task, a
nested <factory> can be used to specify factory settings.
Generate a TESTS-TestSuites.xml file in the directory reports and generate the default framed report in the directory report/html.
<junitreport todir="./reports">
    <fileset dir="./reports">
        <include name="TEST-*.xml"/>
    </fileset>
    <report format="frames" todir="./report/html"/>
</junitreport>
This example requires a file called junitreport/junit-frames.xsl. The XSL
parameters key1
 and key2
 will be passed to the XSL transformation.
<junitreport todir="${outputdir}">
    <fileset dir="${jrdir}">
        <include name="TEST-*.xml"/>
    </fileset>
    <report todir="${outputdir}/html"
            styledir="junitreport"
            format="frames">
        <param name="key1" expression="value1"/>
        <param name="key2" expression="value2"/>
    </report>
</junitreport>