I was trying to create an offline report using ant. <report>
complained that there were non-debug classes, but wouldn't tell me
what they were, even with report verbosity set to "trace3". I
eventually got what I wanted by nuking everything in sight, but never
did find out which were the offending classes. This is EMMA 2.0.4217.
Again, apologies if this is a newbie error, but it all looked correct to me.
Ant output (package names not made public, output is otherwise complete):
[instr] processing instrumentation path ...
[instr] instrumentation path processed in 1281 ms
[instr] [173 class(es) instrumented, 0 resource(s) copied]
[instr] metadata merged into [C:\eclipse\workspace\kit\emma\coverage\metadata.em] {in 31 ms}
.
.
.
[junit] EMMA: collecting runtime coverage data ...
.
.
.
[report] [emma.Processor::run] complete tool properties:
[report] coverage.out.file: [coverage.ec]
[report] coverage.out.merge: [true]
[report] instr.do_suid_compensation: [true]
[report] instr.exclude_bridge_methods: [true]
[report] instr.exclude_synthetic_methods: [true]
[report] metadata.out.file: [coverage.em]
[report] metadata.out.merge: [true]
[report] report.columns: [name,class,method,block,line]
[report] report.depth: [method]
[report] report.html.out.encoding: [ISO-8859-1]
[report] report.html.out.file: [C:\eclipse\workspace\kit/emma/coverage/index.html]
[report] report.metrics: [method:70,block:80,line:80,class:100]
[report] report.out.dir: [C:\eclipse\workspace\kit]
[report] report.out.encoding: [Cp1252]
[report] report.sort: [+block,+name,+method,+class]
[report] report.txt.columns: [class,method,block,line,name]
[report] report.txt.depth: [all]
[report] report.txt.out.file: [coverage.txt]
[report] report.units: [instr]
[report] report.xml.out.encoding: [UTF-8]
[report] report.xml.out.file: [coverage.xml]
[report] session.out.file: [coverage.es]
[report] session.out.merge: [true]
[report] verbosity.level: [trace3]
[report] [EMMA v2.0, build 4217 (2004/07/17 12:19:29)]
[report] input data path:
[report] {
[report] C:\eclipse\workspace\kit\emma\coverage\metadata.em
[report] C:\eclipse\workspace\kit\coverage.ec
[report] }
[report] source path:
[report] {
[report] C:\eclipse\workspace\kit\src
[report] }
[report] processing input file [C:\eclipse\workspace\kit\emma\coverage\metadata.em] ...
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: file length = 1481664
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 24
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 149558 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 31 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 149591
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 2477 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 0 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 152077
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 149558 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 16 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 301644
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 149558 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 15 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 451211
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 149558 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 32 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 600778
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 149558 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 15 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 750345
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 145429 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 16 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 895783
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 145429 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 15 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 1041221
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 145429 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 16 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 1186659
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 145429 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 31 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 1332097
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 149558 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 16 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 1481664
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: file processed in 203 ms
[report] loaded 173 metadata entries
[report] processing input file [C:\eclipse\workspace\kit\coverage.ec] ...
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\coverage.ec]: file length = 526
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\coverage.ec]: position 24
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\coverage.ec]: found valid entry of size 493 and type 1
[report] [emma.data.DataFactory::mergeload] entry read in 0 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\coverage.ec]: position 526
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\coverage.ec]: file processed in 0 ms
[report] loaded 1 coverage data entries
[report] 2 file(s) read and merged in 203 ms
[report] merged metadata contains 173 entries
[report] merged coverage data contains 1 entries
[report] not all instrumented classes were compiled with source file
[report] debug data: no sources will be embedded in the report.
[report] line coverage requested in a report of type [html] but
[report] not all instrumented classes were compiled with line number
[report] debug data: this column will be removed from the report.
[report] showing up to 3 classes without full debug info per package:
[report] writing [html] report to [C:\eclipse\workspace\kit\emma\coverage\index.html] ...
[report] report: processing package [com.caboodlenetworks.package1] ...
[report] report: processing package [com.caboodlenetworks.package2] ...
[report] report: processing package [com.caboodlenetworks.package3] ...
[report] report: processing package [com.caboodlenetworks..] ...
[report] report: processing package [com.caboodlenetworks..] ...
[report] report: processing package [com.caboodlenetworks..] ...
[report] [emma.report.html.ReportGenerator::process] [html] report generated in 2938 ms
Hmm, this looks like a bug. After examining the code, it seems like we have an issue in the metadata merging code: if a class X is first instrumented without full debug info and then instrumented *again* (with full debug info) then the "debug data incomplete" flag is not reset correctly when the later entry overrides the earlier.
Until this is fixed, I can suggest the following as workarounds:
(a) did you nuke stale versions of *.em files as well? Your trace shows that the metadata.em contains multiple entries, meaning that <instr> has been run multiple times with the same file as metadata destination (which is merged in by default). I am guessing some of the earlier runs added some classes without full debug info and those classes were later reinstrumented, which triggers the bug.
Try nuking the stale metadata file at the start of every build or use metadata.out.merge=false mode.
(b) <report> is not the only tool that lists offeding classes. <instr> should do that too. Check if your stdout output contains that helpful info.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Throwing all the generated files away got things the way I needed (but didn't tell me what was wrong :-) ). <instr> didn't help in diagnosis. Today I spent productively working on the unit tests for one class; as I worked at boosting the coverage, I found (and fixed) a few bugs. EMMA was very helpful. Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Vlad,
I was trying to create an offline report using ant. <report>
complained that there were non-debug classes, but wouldn't tell me
what they were, even with report verbosity set to "trace3". I
eventually got what I wanted by nuking everything in sight, but never
did find out which were the offending classes. This is EMMA 2.0.4217.
Again, apologies if this is a newbie error, but it all looked correct to me.
-Dave
---------------------------------------------------------------
Ant fragment:
<emma enabled="${emma.enabled}" >
<instr instrpath="${temp}"
destdir="${kit.instr.dir}"
metadatafile="${coverage.dir}/metadata.em"
merge="true"
/>
</emma>
.
.
.
<emma enabled="${emma.enabled}" >
<report sourcepath="${src}" verbosity="trace3">
<!-- collect all EMMA data dumps (metadata and runtime): -->
<infileset file="${coverage.dir}/metadata.em" />
<infileset file="coverage.ec" />
<html outfile="${coverage.dir}/index.html"/>
</report>
</emma>
---------------------------------------------------------------
Ant output (package names not made public, output is otherwise complete):
[instr] processing instrumentation path ...
[instr] instrumentation path processed in 1281 ms
[instr] [173 class(es) instrumented, 0 resource(s) copied]
[instr] metadata merged into [C:\eclipse\workspace\kit\emma\coverage\metadata.em] {in 31 ms}
.
.
.
[junit] EMMA: collecting runtime coverage data ...
.
.
.
[report] [emma.Processor::run] complete tool properties:
[report] coverage.out.file: [coverage.ec]
[report] coverage.out.merge: [true]
[report] instr.do_suid_compensation: [true]
[report] instr.exclude_bridge_methods: [true]
[report] instr.exclude_synthetic_methods: [true]
[report] metadata.out.file: [coverage.em]
[report] metadata.out.merge: [true]
[report] report.columns: [name,class,method,block,line]
[report] report.depth: [method]
[report] report.html.out.encoding: [ISO-8859-1]
[report] report.html.out.file: [C:\eclipse\workspace\kit/emma/coverage/index.html]
[report] report.metrics: [method:70,block:80,line:80,class:100]
[report] report.out.dir: [C:\eclipse\workspace\kit]
[report] report.out.encoding: [Cp1252]
[report] report.sort: [+block,+name,+method,+class]
[report] report.txt.columns: [class,method,block,line,name]
[report] report.txt.depth: [all]
[report] report.txt.out.file: [coverage.txt]
[report] report.units: [instr]
[report] report.xml.out.encoding: [UTF-8]
[report] report.xml.out.file: [coverage.xml]
[report] session.out.file: [coverage.es]
[report] session.out.merge: [true]
[report] verbosity.level: [trace3]
[report] [EMMA v2.0, build 4217 (2004/07/17 12:19:29)]
[report] input data path:
[report] {
[report] C:\eclipse\workspace\kit\emma\coverage\metadata.em
[report] C:\eclipse\workspace\kit\coverage.ec
[report] }
[report] source path:
[report] {
[report] C:\eclipse\workspace\kit\src
[report] }
[report] processing input file [C:\eclipse\workspace\kit\emma\coverage\metadata.em] ...
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: file length = 1481664
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 24
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 149558 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 31 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 149591
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 2477 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 0 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 152077
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 149558 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 16 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 301644
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 149558 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 15 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 451211
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 149558 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 32 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 600778
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 149558 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 15 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 750345
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 145429 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 16 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 895783
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 145429 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 15 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 1041221
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 145429 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 16 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 1186659
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 145429 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 31 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 1332097
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: found valid entry of size 149558 and type 0
[report] [emma.data.DataFactory::mergeload] entry read in 16 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: position 1481664
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\emma\coverage\metadata.em]: file processed in 203 ms
[report] loaded 173 metadata entries
[report] processing input file [C:\eclipse\workspace\kit\coverage.ec] ...
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\coverage.ec]: file length = 526
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\coverage.ec]: position 24
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\coverage.ec]: found valid entry of size 493 and type 1
[report] [emma.data.DataFactory::mergeload] entry read in 0 ms
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\coverage.ec]: position 526
[report] [emma.data.DataFactory::mergeload] [C:\eclipse\workspace\kit\coverage.ec]: file processed in 0 ms
[report] loaded 1 coverage data entries
[report] 2 file(s) read and merged in 203 ms
[report] merged metadata contains 173 entries
[report] merged coverage data contains 1 entries
[report] not all instrumented classes were compiled with source file
[report] debug data: no sources will be embedded in the report.
[report] line coverage requested in a report of type [html] but
[report] not all instrumented classes were compiled with line number
[report] debug data: this column will be removed from the report.
[report] showing up to 3 classes without full debug info per package:
[report] writing [html] report to [C:\eclipse\workspace\kit\emma\coverage\index.html] ...
[report] report: processing package [com.caboodlenetworks.package1] ...
[report] report: processing package [com.caboodlenetworks.package2] ...
[report] report: processing package [com.caboodlenetworks.package3] ...
[report] report: processing package [com.caboodlenetworks..] ...
[report] report: processing package [com.caboodlenetworks..] ...
[report] report: processing package [com.caboodlenetworks..] ...
[report] [emma.report.html.ReportGenerator::process] [html] report generated in 2938 ms
---------------------------------------------------------------
Hmm, this looks like a bug. After examining the code, it seems like we have an issue in the metadata merging code: if a class X is first instrumented without full debug info and then instrumented *again* (with full debug info) then the "debug data incomplete" flag is not reset correctly when the later entry overrides the earlier.
I have created a new bug issue for this: http://sourceforge.net/tracker/index.php?func=detail&aid=1041120&group_id=108932&atid=651897
Until this is fixed, I can suggest the following as workarounds:
(a) did you nuke stale versions of *.em files as well? Your trace shows that the metadata.em contains multiple entries, meaning that <instr> has been run multiple times with the same file as metadata destination (which is merged in by default). I am guessing some of the earlier runs added some classes without full debug info and those classes were later reinstrumented, which triggers the bug.
Try nuking the stale metadata file at the start of every build or use metadata.out.merge=false mode.
(b) <report> is not the only tool that lists offeding classes. <instr> should do that too. Check if your stdout output contains that helpful info.
Throwing all the generated files away got things the way I needed (but didn't tell me what was wrong :-) ). <instr> didn't help in diagnosis. Today I spent productively working on the unit tests for one class; as I worked at boosting the coverage, I found (and fixed) a few bugs. EMMA was very helpful. Thanks!