On Jan 24, 2005, at 10:30 AM, Mark Meyer wrote:
>
> hi eveyone..
>
> i am new to JUnit, JUnitPerf and Ant.
>
> can someone point me to a tutorial on how to generate reports from
> JUnitPerf
> test suites?
>
> can this be done stand alone or does it have to be done through ant?
To the extent that JUnitPerf tests are just JUnit tests, you can
produce an HTML report of JUnitPerf test results using the standard
<junitreport> task in Ant.
Here's an example that you can add to the build.xml file in your
JUnitPerf distribution that produces a report for all the example
JUnitPerf tests:
<property name="test.reports.dir" location="${build.dir}/reports" />
<target name="test-sample-reports" depends="compile-samples"
description="Runs all the sample tests and generates an HTML
report">
<mkdir dir="${test.reports.dir}" />
<junit haltonfailure="no"
printsummary="no"
fork="no"
errorProperty="test.failed"
failureProperty="test.failed">
<formatter type="plain" usefile="false" />
<formatter type="xml" />
<classpath refid="project.classpath" />
<batchtest todir="${test.reports.dir}">
<fileset dir="${build.dir}">
<include name="**/Example*Test.class" />
</fileset>
</batchtest>
</junit>
<junitreport todir="${test.reports.dir}">
<fileset dir="${test.reports.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${test.reports.dir}" />
</junitreport>
<fail if="test.failed">
Tests failed! Check test reports at ${test.reports.dir}.
</fail>
</target>
Hope that helps.
---
Mike Clark
Clarkware Consulting, Inc.
http://clarkware.com