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
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.