How to get the total number of lines from the cobertura xml report?

Jun 23 at 10:53 AM
Hi,


The current coverage element just mentions the total coverage but there's no way to get the absolute number of lines that have been covered (or not covered).

How could I retrieve this easily?

Cheers
Coordinator
Jul 5 at 8:00 AM
Hello,

Cobertura is a XML format for Cobertura Jenkins plugin and so this information cannot be added directly to the XML.

You can compute it easily by counting the tag line.
  • If hits attribute is "1" (for example <line number="5" hits="1"/>) then the line is covered.
  • If hits attribute is "0" (for example <line number="5" hits="0"/>) then the line is not covered.
I hope this will help,

OpenCppCoverage
Marked as answer by OpenCppCoverage on 8/26/2017 at 6:01 AM