Can I include line coverage in Clover Ant xml report?

Zac Thompson September 11, 2011

Clover 3.1.0 + Jenkins + Ant + Java 6

How can I make <line ... /> elements appear in my clover xml report using the Ant tasks?

I want to feed my Clover coverage statistics into Sonar to view alongside other metrics on the codebase. The project is built in Ant and I am using the <clover-report> task to generate an xml file with details. However, I cannot see the coverage details in Sonar, and I think it is because of those missing values.

It was suggested that the I check the format of my report to see if it was different from their test cases (https://svn.codehaus.org/sonar-plugins/tags/sonar-clover-plugin-2.8/src/test/resources/org/sonar/plugins/clover/XmlReportParserTest/clover.xml). Sure enough, my report does not contain per-line counts (the <line ... /> elements in the example above are not present in my report. How can I cause them to be there? They appear without effort on maven projects.

... Or can someone more familiar with Sonar give me a better suggestion?

1 answer

0 votes
Sean Coughlan December 8, 2011

http://confluence.atlassian.com/display/CLOVER/clover-report

could you be forgetting to include references to the sources in the <clover-report> ?

<clover-report>
<fileset dir='src/main'/>
</clover-report>

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events