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 vote

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 

 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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Fadoua M. Boualem
Published yesterday in Trello

Using Trello to manage events

As a Jira power user, I was at first doubtful that Trello could benefit my workflow. Jira already uses boards (ones you can customize!), so why would I even need to use Trello?! In this post you will...

446 views 6 7
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you