Is it possible for SonarQube to accept lcov code coverage reports for C++ code?

I’m aware there is gcov support for C++, but I don’t see lcov mentioned. Can anyone confirm?

Hi @SakeebHossain,

from lcov webpage:

LCOV is a graphical front-end for GCC’s coverage testing tool gcov. It collects gcov data for multiple source files and creates HTML pages containing the source code annotated with coverage information. It also adds overview pages for easy navigation within the file structure. LCOV supports statement, function and branch coverage measurement.

which means that you are already creating gcov coverage files.

Hey @mpaladin, thanks for the reply.

Yes that is one aspect of LCOV, but it also makes managing GCOV reports simpler. For example LCOV is able to merge multiple GCOV report files into a single one (uses the .info file format), and able to provide more accurate statistics by calculating a baseline for coverage. I noticed for example, that LCOV is supported for JavaScript and was a bit surprised to see C++ support not mentioned, so Just wanted to ask to verify whether LCOV for C++ is supported.

1 Like

Hello @SakeebHossain,

no, it is not supported, in any case it shouldn’t be a big trouble to pass the gcov format in your case.