Test case wise code coverage

84 views
Skip to first unread message

Kiran Tonse

unread,
Jan 16, 2015, 4:10:14 PM1/16/15
to jac...@googlegroups.com
Hello Everyone,

I have a coverage related question. I wanted to check if it is possible to get a suit-wise and test case-wise code coverage. In other words, when a integration/unit test suite is run, is there a way to check which all the classes and methods are being covered by individual tests?

Ex:
Code base:
class1{

method1(){
}
method2{
}
}

my test suite:
test1 covers method1
test2 covers method2

Code coverage report I am looking for is something like below:

<test test1>
  <classes class1>
     <methods method1/>
  </classes> 
</test>
<test test2>
  <classes class1>
     <methods method2/>
  </classes> 
</test>

Please let me know if this is possible.

Thanks
Kiran

Marc R. Hoffmann

unread,
Jan 16, 2015, 5:09:04 PM1/16/15
to jac...@googlegroups.com
Hi Kiran,

JaCoCo does not support this out of the box. JaCoCo is a general purpose code coverage tool for the JVM and has no notion about particular test frameworks.

SonarQube provides a specific JUnit test listener to separate code coverage per test and also provides per-test reports. Others have successfully implemented this:

https://deors.wordpress.com/2014/07/04/individual-test-coverage-sonarqube-jacoco/

You can also implement your own test listeners and use JaCoCo APIs to dump execution data for every test.

Best 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/0767c042-5e5a-4ab3-bc5c-354568ab1875%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
Marc Hoffmann
hoff...@mountainminds.com
_______________________________________________
Mountainminds GmbH & Co. KG

Nussbaumstr. 4 * 80336 Muenchen * Germany 
Phone/Fax +49-700-68664637 * 0700-MTNMINDS

Registergericht Muenchen * HRA 80201
Mountainminds Verwaltungs GmbH
Registergericht Muenchen * HRB 143183
Geschaeftsfuehrer Marc Hoffmann

Kiran Tonse

unread,
Jan 16, 2015, 8:07:19 PM1/16/15
to jac...@googlegroups.com
Thank you very much Marc.

--
You received this message because you are subscribed to a topic in the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jacoco/0TeA9zxCwxg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jacoco+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco/54B98BF8.5010305%40mountainminds.com.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages