Skip to content

Instantly share code, notes, and snippets.

@brindy
Created May 29, 2009 14:40
Show Gist options
  • Save brindy/119980 to your computer and use it in GitHub Desktop.
Save brindy/119980 to your computer and use it in GitHub Desktop.
Sample JUnit ant task configuration to use Emma for code coverage on the fly.
<junit fork="yes" printsummary="yes">
<classpath refid="emma.classpath" />
<!-- general stuff -->
<classpath>
<!-- the test classes. -->
<pathelement location="bin" />
<!-- contains junit and other dependencies -->
<path refid="classpath.compile" />
</classpath>
<formatter type="xml" />
<batchtest todir="${test.output}" haltonerror="false" haltonfailure="false">
<fileset dir="src">
<include name="**/*Test.java" />
</fileset>
</batchtest>
<!-- Pass EMMA configuration on the 'command line' -->
<jvmarg value="-Xbootclasspath/a:${basedir}/${lib.emma}/emma.jar" />
<jvmarg value="emmarun" />
<jvmarg value="-out" />
<jvmarg value="${test.output}/coverage.emma" />
<jvmarg value="-raw" />
<jvmarg value="-merge" />
<jvmarg value="yes" />
<jvmarg value="-ix" />
<jvmarg value="*arum*" />
</junit>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment