title: Filtering junit test classes from Emma Code Coverage Report
body: <p>I have a project where I have the emma code coverage script (using ant) building and generating the tests correctly. </p>
  
  <p>I have two packages
      com.myproject.abc
      test.com.myproject.abc</p>
  
  <p>All of the junit tests are in the test.com.mywebsite.abc package. My goal is to NOT have the test.com.myproject.abc package included in the report (coverage.xml). I've read the emma documentation about coverage filters  and looked at several other examples, but cannot get it to work without including the junit tests in the instrumentation.</p>
  
  <p>If I include the filter in the instrumentation target ... it does not instrument the junit classes, which are used for the junit test. The result is a classNotFoundException.</p>
  
  <p>Here is my code.</p>
  
  <pre><code>&lt;target name="emma-instrument" depends="clean" description="instruments the code"&gt;   
          &lt;emma enabled="true"&gt;  
              &lt;instr instrpath="${classes}" destdir="${emma.instr.dir}"  
                  metadatafile="${emma.coverage.dir}/coverage.emma" merge="true" &gt;
                  &lt;filter excludes="test.com.myproject.abc"/&gt; 
              &lt;/instr&gt;
           &lt;/emma&gt;
  
      &lt;/target&gt;  
  </code></pre>
  
  <p>When the instrumentation happens, it moves all of the instrumented classes to emma/instrumentation - which IS included in the classpath. </p>
  
  <pre><code>&lt;target name="test" depends="test_preconditions" description="run junit tests"&gt;  
          &lt;junit fork="yes" printsummary="yes" haltonfailure="yes"&gt;  
              &lt;classpath refid="test.classpath" /&gt;  
              &lt;formatter type="plain" usefile="false" /&gt;  
              &lt;batchtest&gt;  
                  &lt;fileset dir="${classes}"&gt;
                      &lt;include name="**/*Test*"/&gt;
  
                  &lt;/fileset&gt;
              &lt;/batchtest&gt;  
              &lt;jvmarg value="-Demma.coverage.out.file=${emma.coverage.dir}/coverage.emma" /&gt;  
              &lt;jvmarg value="-Demma.coverage.out.merge=true" /&gt;  
              &lt;jvmarg value="-XX:-UseSplitVerifier"/&gt;
          &lt;/junit&gt;  
      &lt;/target&gt;  
  </code></pre>
  
  <p>So just to repeat - is it possible to exclude the JUNIT tests from the Emma Coverage report? What do I need to change? Thanks in advance.</p>
  
  <p>I am using emma 2.1 (code coverage), java and ant.</p>