How to get sonarqube coverage from gcovr3.2

I am building and testing the c++ code in ubuntu 16 with gcovr 3.2. I am able to use build-wrapper and sonar-scanner fine but when it comes to coverage report gcovr only generate --xml not --sonarqube and not able to get coverage.

Hi @Sumanth_Anumolu ,
gcovr 3.2 is quite old (8 years). The --sonarqube option has been added with gcovr 4.2. Can you try upgrading your gcovr version and see whether that fixes your problem?
You can find an example of a gcovr project with sonarqube here: GitHub - sonarsource-cfamily-examples/linux-cmake-gcovr-gh-actions-sc: An example C++ repository built with CMake on Linux using GitHub Actions and analyzed on SonarCloud (test coverage by gcovr)
Thanks,

I am using ubuntu 16 , it supports only gcovr-3.2. it wont support 4.2.

Hi @Sumanth_Anumolu,
The version available through apt install gcovr is 3.2, but I don’t think it is the only supported version. On a Ubuntu 16.04, we did a test running the following:

apt update
apt install -y python3-pip
pip3 install gcovr==4.2

and it did succeed in installing gcovr 4.2.