C/C++ code coverage

Hi,

Environment description: Windows, SonarQube server 9.9, sonar-scanner-5.0.1.3006-windows (under a docker image), Visual Studio 2019 Enterprise with CodeCoverage tool integrated, reportgenerator, GitLab

I am currently working on the projects c/c++ code coverage integration on which I faced with some issues.
For c/c++ I managed to set up the PC_Lint report and I also managed to set up the code coverage for c# projects, but code coverage for c/c++ I cannot.
I managed to create the “.coveragexml” under the Windows with the VS2019 Enterprise edition using the “CodeCoverage.exe” integrated tool.
Commands used:
- generate VS2019 coverage xml report (coverage.coveragexml):
CodeCoverage.exe collect /output:coverage.coverage UnitTests.exe
CodeCoverage.exe analyze /output:“.\coverage.coveragexml” “.\coverage.coverage”
- to upload the report to the SonarQube server:
/Tools/sonar-scanner-5.0.1.3006-windows/bin/sonar-scanner.bat" -X -D sonar.host.url=$SONAR_QUBE_HOST_URL -D sonar.login=$SONAR_QUBE_TOKEN
- the sonar-project.properties contains:
sonar.projectName= “<doesn’t matter>”
sonar.projectVersion= 1.0
sonar.sources= .
sonar.sourceEncoding=UTF-8
sonar.cfamily.vscoveragexml.reportsPath = coverage.coveragexml

I also analyzed the coverage.coveragexml and the conntent of the report looks ok.
My issue is when I try to upload to SonarQube with sonar-scanner then the file is not parsed.

I also tried to convert the “.coveragexml” into a general “.xml” format using command ‘reportgenerator “-reports:coverage.coveragexml” “-targetdir:CoverageReport” “-reporttypes:SonarQube”’ and settings “sonar.coverageReportPaths= Summary.xml” which is parsed but also show nothing.

I would prefer to use only the “.coveragexml” generated and to be uploaded/parsed when runs the sensors.

What I do wrong, what I missed?

Thank you in advance any answares/observations.

Updates: 1 settings issue found:

What Happens
SonarQube respects SCM ignore settings by default. If a file or directory is listed in .gitignore (or equivalent for other SCM systems), SonarQube will not include it in the analysis unless explicitly instructed otherwise.
The error message in the log:
DEBUG File ‘<path_to>\coverage.coveragexml’ is excluded by the scm ignore settings.
indicates that the file coverage.coveragexml is being excluded from SonarQube analysis because it matches a pattern defined in your source control management (SCM) ignore settings, such as .gitignore or .hgignore.

.gitignore:
##Visual Studio code coverage results
*.coverage
*.coveragexml

But still nothing.

Resolved.
Using the “sonar.cxx.vscoveragexml.reportPaths=CodeCoverageReport.coveragexml” setting.