I'm using Jacoco as a Java agent to instrument classes to obtain coverage information. Currently, I can get the probe hit count of a given class. I followed the example from https://www.eclemma.org/jacoco/trunk/doc/examples/java/ExecDump.java to retrieve the number of probes hit for each class as recorded in a specified .exec file.
However, how can I get a finer granularity coverage report, specifically one that includes method information? Is it possible to associate the probe array with a set of methods?
I am able to get this information if I don't use Jacoco as a Java agent and make calls directly to the Jacoco.core.analysis package. However, if I need to use Jacoco as a Java agent, how could I get this same information?
Thank you!
Thank you for the reply!
The runtime API looks promising. It appears I can retrieve the IAgent instance and call getExecutionData().
However, that returns a byte array. To what could I pass this byte array to, to start analyzing the data and retrieving method coverage information?
Thank you!