Is there an ability to generate code coverage reports for a JAR file belonging to my class path?
The jar
is already compiled and added as a library to Gradle project.
The test code for jar
is stored in the project.
Is there an ability to generate code coverage reports for added to classpath jar?
There should be. You are not telling which code coverage tool you are using though. From the tags in the question it appears you are using JaCoCo.
Code coverage typically goes through 3 phases:
In your scenario, what you could do is to unzip the JAR for which you want to have code coverage, instrument the classes within and zip these classes to another JAR. Replace the original JAR with the JAR with instrumented classes.
This is a non standard workflow and may not be easily configured in Ant/Maven, but you can do it programmatically, see the API and API examples
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With