Hi Scott,

please use ISourceFileCoverage instead of IClassCoverage. A source file can contain more then one class. ISourceFileCoverage merges the line coverage of all classes contained. Also ISourceFileCoverage has a name (e.g. "Example.java") and a package name (e.g. "org/jacoco/example") which can be used to identify the corresponding source file.

The following classes show how source higlighting is done in JaCoCo and in EclEmma:

https://github.com/jacoco/jacoco/blob/master/org.jacoco.report/src/org/jacoco/report/internal/html/page/SourceHighlighter.java
https://github.com/jacoco/eclemma/blob/master/com.mountainminds.eclemma.ui/src/com/mountainminds/eclemma/internal/ui/annotation/CoverageAnnotationModel.java#L212

Best regards,
-marc

On 02.04.14 00:51, Scott Morgan wrote:
Hi,

I have been doing some work to try build a JUniit like api with code coverage included in the results. I am at the point where I can get IClassCoverage and from there ILine coverage, however when I use EclEmma in eclipse it highlights the source code lines.
Where is the mapping from IClassCoverage/ILine to source code done?
In jacoco or eclemma?

Can anyone create a simple example for mapping back to the source code?

Cheers,
Scott
--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "JaCoCo 
and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to