C++ coverage and multiple MS coverage reports

Hi there,

I had a quick question that I just wanted some confirmation on. For generating code coverage reports for our C++ projects we historically use OpenCppCoverage, which produces a reports in the generic SonarQube coverage format. With this we we able to supply multiple report paths using the sonar.coverageReportPaths parameter. Recently we are looking at moving to Microsoft’s code coverage tool, however from our testing it appears that the sonar.cfamily.vscoveragexml.reportsPath only supports a single report and raises an error if multiple comma-delimited paths are supplied. Is there any reason for this difference? It does seem a little strange especially as the documentation explicitly states that sonar.cs.vscoveragexml.reportsPaths and sonar.vb.vscoveragexml.reportsPaths do support multiple comma-delimited report paths - why the difference between handling of the reports between Visual C++ and .NET? Is this something that you will plan on supporting at a later date or is it necessary for us to merge all our C++ coverage reports into a single report (which is technically possible when running the codecoverage.exe analyze command, though means re-engineering our pipelines)

FYI are we running SonarQube 8.9.1 LTS on-prem.

Thanks is advance,

Sam

Hi @Sam_Anthonisz ,

indeed as you point out there is a bit of inconsistency across the analyzers, clearly sonar.cfamily.vscoveragexml.reportsPath is accepting a single report as described in the docs.

I created CPP-3242 to add support for multiple reports. However, I cannot make promises about the ETA, and for sure as it would be a new feature it wouldn’t make it back to SonarQube 8.9.1 LTS.

Hi @mpaladin,

Thanks for the update and creating that issue. Understand that it would be a new feature, but glad to see it will bring a bit more consistency in the future. We’ve been able to work around the issue for now by merging our coverage reports together, so it isn’t a blocker for us.

Cheers,

Sam

1 Like

Hi @Sam_Anthonisz,

glad you managed to work it out and thank you for the update.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.