Cxx Plugin does not run any tests or produce coverage results, thus test and coverage reports must be created before running the analysis |
The C++ plugin supports importing of unit test data from various formats.
The C++ Plugin parses xunit compliant format using the sonar.cxx.xunit.reportPath. To use other formats, first they need to be converted using the property sonar.cxx.xunit.xsltURL
For convenience the following xsl are provided
0.2 version supports 3 types of coverage. Unit, Integration and Overall coverage. The following properties should be use to import the coverage reports
Cobertura and Bullseye (http://www.bullseye.com/) XML formats are supported from 0.2 version. Previous versions support only Cobertura, and sonar.cxx.gcovr.reportPath needs to be set.
gcovr -x -r . > report.xml |
covxml -f UTCoverage.cov -o bullseyecoverage-result-0.xml |
covmerge -c ITCoverage.cov UTCoverage.cov -f ALLCOVERAGE.cov |
Notes about coverage display in sonar:
Sonar <3.2 provides metrics for line coverage and branch coverage. Bullseye users have function and branch/decision coverage instead, the cxx plugin coverts the second directly into branch coverage however line coverage is far more complex and cannot be correlated directly into function coverage.
Line coverage imported from a bullseye report means than function coverage + line branch coverage ( this second occurs since sonar will not display branch coverage if there isn't a line it associated with it). This means also that overall coverage will be affect in sonar and cannot be compared directly to bullseye results. The following pictures illustrate this for a small example project.

