Get list of tests that cover any java source class, in coverage report

24 views
Skip to first unread message

Shishir Kumar

unread,
Jul 7, 2022, 3:40:38 AM7/7/22
to JaCoCo and EclEmma Users
Hi,
How can I get the list of test classes that covered/exercised a java source class. Is it possible to get this info in the JaCoCo code coverage report (html or xml)? I want to use this info to map tests to source code and use it for test selection.
I have no prior experience with JaCoCo. Any help would be greatly appreciated.
Thanks

Marc Hoffmann

unread,
Jul 7, 2022, 8:42:37 AM7/7/22
to JaCoCo and EclEmma Users
Hi,

JaCoCo is completely framework agnostic and has no idea about the scope of a JUnit test case. Therefore JaCoCo does not offer per-test coverage.

Technically this can be done by running each test individually and create a coverage report for every test. But I assume that this will result in an enormous amount of data.

Regards,
-marc

--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/671d157a-1c1d-4a74-ad2e-9d1fb88ddea1n%40googlegroups.com.

Ullrich Hafner

unread,
Jul 7, 2022, 2:07:43 PM7/7/22
to jac...@googlegroups.com
You can have a look at the implementation of PIT (https://pitest.org/). If I remember correctly, they select test cases based on the individual coverage.

Reply all
Reply to author
Forward
0 new messages