JaCoCo coverage per test

1,978 views
Skip to first unread message

Alex Gyori

unread,
Nov 2, 2013, 7:12:41 PM11/2/13
to jac...@googlegroups.com
Hello,

I'm using JaCoCo as an ant task and I get coverage results per line for each source file in the XML results file. This coverage is reported for the entire test suite ran.

Is there a builtin way to get the coverage for each specific test that is run from the test suite?

Thank you in advance,
Alex

Marc R. Hoffmann

unread,
Nov 3, 2013, 1:56:33 AM11/3/13
to jac...@googlegroups.com
Hi Alex,

JaCoCo itself does not support this out of the box. SonarQube analysis can provide coverage per test based on JaCoCo:  

http://docs.codehaus.org/display/SONAR/Code+Coverage+by+Unit+Tests+for+Java+Project

Best regards,
-marc

alexand...@gmail.com

unread,
Nov 5, 2013, 8:19:43 PM11/5/13
to jac...@googlegroups.com
Hi Marc,

Since Sonar is able to use JaCoCo reports to report coverage in a per test fashion, it means JaCoCo generates that information. Right?
Is there a way for me to access that information?
I don't necessarily mean out of the box, but parse some file to get that info?

Thanks,
Alex

Marc R. Hoffmann

unread,
Nov 6, 2013, 12:57:10 AM11/6/13
to jac...@googlegroups.com
Hi Alex,

no, plain JaCoCo does not generate this information because it has no
notion of execution boundaries between test cases. Sonar basically
introduces custom test runners which dump execution data separately for
every test case.

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