How to compute code coverage for all JARs of a project

37 views
Skip to first unread message

Florian Reisinger

unread,
Jan 18, 2018, 9:47:09 AM1/18/18
to JaCoCo and EclEmma Users

[Repost as I forgot to add a meaningful title]

I have a folder with multiple JAR files files called /lib

from the root folder of "lib" I wanted to create a batch script, which executes a main file in "A.jar", but also collects information about the coverage of "B.jar" (A.jar has dependecies in B.jar)

A simplified version of the script I am executing is:

java.exe -ea -Xmx2g -javaagent:jacocoagent.jar=destfile=./coverage.exec -cp "lib/*" at.my.Main Param1 Param2

Result: I get code coverage results for all classes in "A.jar", but none for "B.jar".

Do you have an idea how to get results as well from "B.jar"?

If possible please answer for the Gradle plugin jacoco

Thanks for your time!

Florian

Florian Reisinger

unread,
Jan 18, 2018, 12:57:28 PM1/18/18
to JaCoCo and EclEmma Users
Hi,

Found it out! Using the Gradle plug-in now.

The next question I am facing is how to add the sources in jar files (or in Gradle dependencies the sources.jar)


Thank you again!

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