Getting test-class from JaCoCo coverage analyzis ?

35 views
Skip to first unread message

Thibault Beziers la fosse

unread,
Feb 13, 2017, 11:06:12 AM2/13/17
to JaCoCo and EclEmma Users

Hello,

I'm currently using the JaCoCo API to get coverage information after running some tests with
JUnitCore.runClasses(Class<?> ...)

I was wondering if there's a way to get the test classes back with only the coverage results gathered in the 
org.jacoco.core.analysis.CoverageBuilder
For example, if I run 3 tests classes, testing a target class, I'd like to know which test method (or test instruction) has covered which target method (or target instruction).
For know I run my tests individually, and fetch the coverage information like that, but I'd like to know if there's an easier way to do that.

Thank you



bjk...@gmail.com

unread,
Feb 13, 2017, 11:18:22 AM2/13/17
to JaCoCo and EclEmma Users
No, JaCoCo doesn't track call stacks; it only tracks whether some code path was covered. You'll need to collect the execution data after each test method and analyze the coverage for each test method separately.

Thibault Beziers la fosse

unread,
Feb 14, 2017, 3:20:03 AM2/14/17
to JaCoCo and EclEmma Users, bjk...@gmail.com
Ok, I guess I'll keep it that way then.

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