I'm currently investigating a way of finding which branches are executed from my system tests. If I view the XML report I can get the info but it only gives me 'how many' branches have been covered and not 'which' branches.
I got everything working fine in terms of generating the jacoco.exec file and can view the 'which' info in the generated HTML reports.
So it's clear that jacoco has this info and 'paints' the HTML reports accordingly but this info does not seem to appear in the XML report where I could parse it out.
The issue I have is that I want to be able to parse the coverage info 'automatically' to determine if the new tests have covered any additional branches. If they have I can add them to my test suite and if not I can dispose of them as 'already covered'. I can tell if coverage has increased but it would be better if I could 'map' tests to actual branches covered.
Is there some way I could extend the jacoco source to get this info or maybe use the API.
I managed to do something similar in the old EMMA source by simply printing out to console and redirecting to a file but I need this in our new Java7 code base:
File: core\java12\com\vladium\emma\report\MethodItem.java
Line: 103
Insert: System.out.println("Block "+parent.m_cls.getClassVMName()+"."+method.getName()+"."+b+" covered");
Anyone else come across this issue or have any ideas ?
Thanks and regards,
Colm