Code coverage is not reflecting in sonarQube


I am trying to get code coverage in sonarQube for a visual studio project, I have a unit test project that generates a .exe file and a project for which the unit test has to be done.

I tried to generate the code coverage from the visual studio for the C/C++ project following this link: [Coverage & Test Data] Generate Reports for Apex, C/C++, Objective-C, Go, JS/TS and Python.

The .xml file I used is as follows:
C:\SonarQube\sonar-scanner-\bin\sonar-scanner.bat -D"sonar.projectKey=MyTestProjectKey" -D"sonar.sources=." -D"" -D"sonar.cfamily.vscoveragexml.reportsPath= <<.xml PATH>>" -D"<>" -D"sonar.login=<>"

But the issue is the .xml file seems empty. Also, I tried to generate .coveragexml from visual studio “Test->Analyze code coverage for all tests” but if I use that still no coverage is getting displayed on sonarQube.

FYI, I am using the visual studio enterprise 2019 edition. Any help regarding getting code coverage for a C/C++ project is appreciated.



Are you saying your coverage report is empty? If so, that’s going to be the first, step, but getting there is out of scope for this community.