Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The <a href="http://emma.sourceforge.net/userguide_single/userguide.html#N10291" rel="nofollow noreferrer">User Guide has a good example of how to set up your build script</a> so that you not only seperate the instrumented code from the execution, but it's also all contained in the same <code>&lt;target&gt;</code> so that you don't have to run a series of different targets, but instead you can just do something like <code>ant emma tests</code> (if <code>ant tests</code> was how you normally ran your unit tests, for example).</p> <p>Here's their example:</p> <pre><code>&lt;target name="emma" description="turns on EMMA instrumentation/reporting" &gt; &lt;property name="emma.enabled" value="true" /&gt; &lt;!-- EMMA instr class output directory: --&gt; &lt;property name="out.instr.dir" value="${basedir}/outinstr" /&gt; &lt;mkdir dir="${out.instr.dir}" /&gt; &lt;/target&gt; &lt;target name="run" depends="init, compile" description="runs the examples" &gt; &lt;emma enabled="${emma.enabled}" &gt; &lt;instr instrpathref="run.classpath" destdir="${out.instr.dir}" metadatafile="${coverage.dir}/metadata.emma" merge="true" /&gt; &lt;/emma&gt; &lt;!-- note from matt b: you could just as easily have a &lt;junit&gt; task here! --&gt; &lt;java classname="Main" fork="true" &gt; &lt;classpath&gt; &lt;pathelement location="${out.instr.dir}" /&gt; &lt;path refid="run.classpath" /&gt; &lt;path refid="emma.lib" /&gt; &lt;/classpath&gt; &lt;jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma" /&gt; &lt;jvmarg value="-Demma.coverage.out.merge=true" /&gt; &lt;/java&gt; &lt;emma enabled="${emma.enabled}" &gt; &lt;report sourcepath="${src.dir}" &gt; &lt;fileset dir="${coverage.dir}" &gt; &lt;include name="*.emma" /&gt; &lt;/fileset&gt; &lt;txt outfile="${coverage.dir}/coverage.txt" /&gt; &lt;html outfile="${coverage.dir}/coverage.html" /&gt; &lt;/report&gt; &lt;/emma&gt; &lt;/target&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload