Read coverage information directly from .exec files

47 views
Skip to first unread message

pag...@cqse.eu

unread,
Jan 9, 2017, 3:40:56 AM1/9/17
to JaCoCo and EclEmma Users
Hi there,


we are authors of a source code analysis suite that also shows code coverage.

Users who trace code coverage with JaCoCo are currently required to first convert their .exec files to .xml reports using, e.g., the corresponding ant task. Then they upload the .xml coverage report to our tool.

We would like to make things easier for them by allowing them to upload the .exec files directly. But this means that we need to interpret these files ourselves.

Question: Is there any JaCoCo library or API that allows us to interpret these files in such a way that we can read out the coverage information directly? We have access to the source code of the covered application.


Thanks in advance,
Dennis

bjk...@gmail.com

unread,
Jan 9, 2017, 11:22:00 AM1/9/17
to JaCoCo and EclEmma Users, pag...@cqse.eu
See the "API JavaDoc" link from the documentation page: http://www.eclemma.org/jacoco/trunk/doc/

The ExecutionDataReader class reads .exec files, and the Analyzer class converts ExecutionData to IClassCoverage. Note that Analyzer requires access to the original .class files (.exec files contain per-class lists of true/false "probes", which are meaningless without a corresponding .class file, which contain the actual method names, line numbers, etc.). You might also be interested in the CoverageBuilder or XMLFormatter classes depending on what you're trying to do exactly.

Evgeny Mandrikov

unread,
Jan 9, 2017, 4:17:24 PM1/9/17
to JaCoCo and EclEmma Users, pag...@cqse.eu, bjk...@gmail.com
Also note that content of exec file might change from one JaCoCo version to another - see https://github.com/jacoco/jacoco/wiki/ExecFileVersions And as an examples of consequences of usage of exec file see https://github.com/jenkinsci/jacoco-plugin/pull/55#issuecomment-124449625 and http://stackoverflow.com/questions/30459260/jacoco-sonarqube-incompatible-version-1007

Regards,
Evgeny

Dennis Pagano

unread,
Jan 10, 2017, 2:27:01 AM1/10/17
to Evgeny Mandrikov, JaCoCo and EclEmma Users, bjk...@gmail.com
Thanks guys! That helps a lot.

Best,
Dennis
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages