clover

Janith Harendra August 30, 2015

We are trying to implement clover with Bamboo for C++ code coverage. According to the information we found, Clover does not fully support C++ coverage (Only line coverage summary). We are using the popular gcov_to_ clover. py for  the conversion.

 

We are trying to modify the script file to process the branch, conditional coverage information in gcov file also.

But we still don't know how to handle this information in clover.xml.

 

Is there a way to find the schema for the clover.xml file. so we can handle the above information also.

 

Thanks in advance !!!

 

1 answer

1 accepted

0 votes
Answer accepted
Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 30, 2015

Hi Janith,

Clover does not fully support C++ coverage (Only line coverage summary)

Or more precisely: Clover does not support C++. What you can do with the gcov_to_clover.py script is to convert GCOV data to Clover's XML file format. Which can be later parsed by the Bamboo Clover Plugin and this way display a simple coverage % bar on a build summary page. 

 

We are trying to modify the script file to process the branch, conditional coverage information in gcov file also. But we still don't know how to handle this information in clover.xml.

Could you please tell me how you'd like to use this branch & conditional coverage? I'm asking because having more detailed data will not cause any significant difference in how Bamboo displays it. On a build summary page, on a Clover tab you will just have more metrics displayed. Is it sufficient for you?

 

Is there a way to find the schema for the clover.xml file. so we can handle the above information also.

Please download the Clover-for-Ant ZIP file and unpack it. The etc/schema.xsd describes format of an XML report. 

In case you just need to display more data on the "Clover" tab in Bamboo, you have to fill more data for attributes in the /coverage/project/metrics element. Example:

<metrics coveredelements="0" complexity="1" loc="5" methods="1" classes="1" statements="1" packages="1" coveredconditionals="0" coveredmethods="0" elements="2" ncloc="0" files="1" conditionals="0" coveredstatements="0"/>
  • methods / coveredmethods - it's a method coverage
  • statements / coveredstatements - a statement coverage
  • conditionals / coveredconditionals - a branch coverage
  • elements / coveredelements - it's just a sum of methods + statements + conditionals

 

Cheers
Marek 

Janith Harendra September 4, 2015

 Hi Marek,

Thank you so much for the quick reply.

Could you please tell me how you'd like to use this branch & conditional coverage? I'm asking because having more detailed data will not cause any significant difference in how Bamboo displays it. On a build summary page, on a Clover tab you will just have more metrics displayed. Is it sufficient for you?

We are trying to create something similar to what is displayed for Java code coverage by clover. Basically our main target is to  implement something closer to what is displayed in the dashboard for Java coverage.

Cheers,

Janith

Marek Parfianowicz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 4, 2015

Please note that Clover itself cannot generate its HTML report from the XML one (it needs clover.db). However, you can trick the Bamboo Clover Plugin to reuse its "Clover" tab to display any kind of an HTML report. Please have a look at this link: https://answers.atlassian.com/questions/11436932

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events