3

Our Sonar Build Environment details as follows:

SonarQube Server Version - 5.6.6 (64-Bit).
Sonar Client Build Operating System – Ubuntu 14.04.5 LTS (64-Bit).
Sonar-scanner- Version - 3.0.3.778.
sonar-cxx-plugin-0.9.7.jar
Source Code Language: C++

Description:-

I have .gcov coverage report. Want to know is it possible to import into Sonarqube dashboard using Cxx community plugin?

If so, kindly help me with the steps. Thanks in advance.

user4948798
  • 1,924
  • 4
  • 43
  • 89

1 Answers1

1

Use absolute filename path in gcovr report solved for me.

sonar config file: sonar-project.properties

sonar.projectKey=xxx
sonar.sources=src
sonar.host.url=http://xxx:xxx
sonar.login=xxx
sonar.language=c++
sonar.cxx.includeDirectories=xxx
sonar.exclusions=xxx
sonar.cxx.coverage.reportPath=gcovr_report.xml
sonar.cxx.coverage.itReportPath=gcovr_report.xml
sonar.cxx.coverage.overallReportPath=gcovr_report.xml

gcov temp file gcda/gcno in directory /xxx/src.

create gcovr xml report: gcovr -r /xxx/src --xml-pretty > gcovr_report.xml

replace filename tag in gcovr_report.xml with absolute path.

run sonar runner: ~/sonar-scanner-3.0.3.778-linux/bin/sonar-scanner -X

hailinzeng
  • 966
  • 9
  • 24
  • Yes Hailin. With gcovr-3.3 version generated report modified the filename tag with complete path. Post that able to view results in sonarqube dashboard. Thank you. – user4948798 Dec 04 '17 at 12:28