views:

253

answers:

4

Hi, I'm trying to understand Emma the code coverage tool and it seems ok till the moment I need the metadata, for example which line exactly is left out or is covered. I need this information for my own application but can't get to it. The xml report doesn't provide it. I would be thankful if anybody can help.

A: 

Try to use the "-raw" option when running Emma. This dumps alot of stuff into a file. There should be your desired information in.

Mork0075
+1  A: 

On a side note: another great code coverage tool is Cobertura. I've used this a lot and its very easy to get running.

Fortyrunner
A: 

What you need here is to create html coverage report. Apache Velocity coverage report is an example. To generate it use Emma Ant tasks:

<emma>
    <report sourcepath="${src.dir}">
        <fileset dir="${build.dir}" >
            <include name="coverage.em" />
        </fileset>
        <fileset file="${emma.ec.file}" />

        <html outfile="${html.cov.file}" />
    </report>
</emma>

If you use Eclipse you might consider installing plugin EclEmma that highlights the executed and non-executed lines of code right in the IDE.

wheleph
A: 

I think what I'm reading is that you are able to see coverage reports telling you what percentage were covered, but you are unable to drill down to the actual highlighted source showing which individual lines were covered.

Possibly you are compiling without debugging symbols. Change your javac task to specify debug="true" and debuglevel="lines,vars,source".

Kevin Peterson