View Source

To add JUnit report, only need two steps:
# Add generate JUnit report from [Ant|http://ant.apache.org] or [Maven|http://maven.apache.org] or any other build tools
# Add publish JUnit report step in the QuickBuild

h2. Generate JUnit Report
QuickBuild will NOT generate JUnit report automatically, so first make sure the JUnit report is produced by [ANT|http://ant.apache.org] or by any other build tools, the following example shows how to generate JUnit test results by [Ant JUnit task|http://ant.apache.org/manual/OptionalTasks/junit.html]:

{code:xml|title=JUnit target in build.xml}
<target name="junit">
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<pathelement location="${build.tests}"/>
<pathelement path="${java.class.path}"/>
</classpath>

<formatter type="xml"/> <!-- DO use xml here -->

<batchtest fork="yes" todir="reports/junit">
<fileset dir="${src.tests}">
<include name="**/*Test*.java"/>
<exclude name="**/AllTests.java"/>
</fileset>
</batchtest>
</junit>
</target>
{code}

The code snippet will generate the XML reports for each test case, and the reports will be captured to 'reports/junit' directory. You may also want to merge all the test case report by using [Ant JUnitReport task|http://ant.apache.org/manual/OptionalTasks/junitreport.html] like:
{code:xml|title=JUnitReport task in build.xml}
<target name="junit">
<junit>
... ...
</junit>

<junitreport todir="${outputdir}">
<fileset dir="reports/junit">
<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>
</target>
{code}

After adding generate the XML report(s) for your test results, you can tell QuickBuild to add those results now.

h2. Adding JUnit Report
Just like all other [build reports|Build Reports], to add JUnit report is by adding a publish step in a [configuration|Configuration].