views:

1067

answers:

3

Hi,

I have an issue with EMMA where it is correctly covering all my various Java projects except one. I am puzzled as to why this occurs as the ANT script appears to be correct. The following expected output is given:

 [echo] c:\cc_local_home\emmadata\ProjectName
[instr] processing instrumentation path ...
[instr] instrumentation path processed in 1876 ms
[instr] [84 class(es) instrumented, 0 resource(s) copied]
[instr] metadata merged into [c:\cc_local_home\data\2008-11-17_14.35.19\coverage.emma] {in 62 ms}

The above is generated by the following piece of ANT script:

< target name="emma" depends="init" if="use.emma">
  < echo message="${emma.bin}" /> 
  < emma enabled="true">
    < instr instrpath="${test.bin}" destdir="${emma.bin}" metadatafile="${test.data.dir}/coverage.emma" merge="true">
      < filter excludes="*Test*,*test*" /> 
      < filter excludes="*Exception" /> 
      < filter excludes="*AppConstants" /> 
    < /instr>
  < /emma>
< /target>

After the JUnit tests are run, the following is logged.

emma.report: [report] processing input files ...
[report] 1 file(s) read and merged in 16 ms
[report] nothing to do: no runtime coverage data found in any of the data files

And no coverage report is generated.

I am certain that the coverage.emma files are being linked correctly so why is EMMA not covering the code?

The

+1  A: 

What does the <emma.report> element look like?

You may want to look at this FAQ concerning this exact message: Why does <report></report> say "nothing to do: no ...data found in any of the data files" and exit without generating anything?

And, as always with Ant, turn on -verbose and double check the output.

Ken Gentle
A: 
<target name="emma.report" if="use.emma">
  <emma enabled="true">
    <report sourcepath="${test.reports.dir}"> 
      <infileset dir="${test.data.dir}" includes="*.emma" /> 
      <html outfile="${test.reports.dir}/coverage.html" /> 
    </report>
  </emma>
</target>
This information is best captured by editing the question and putting it there.
Alex B
+1  A: 

I would check to make sure that the JUnit target is running the instrumented code, and not running non-instrumented code (which would not produce any coverage data).

matt b