No coverage when using the Generic file format

Hello,

We have a devel edition and are uploading coverage data using the generic format for our c/c++ project. Unfortunately, the code coverage shown by Sonar is always 0%.

we use the -Dsonar.coverageReportPaths=… to tell Sonar about the XML file. The paths inside the XML file are in the form “src/…” which match the way Sonar is showing them in the Code browser tab.

How can we diagnose what is happening ?

Thanks

Hi Dexter,

Try running analysis with the -X switch or -Dsonar.verbose=true and then show us your analysis logs, or at least the part that pertains to the reading - or not - of the report file.

 
Ann

P.S. It would also be helpful to have some version numbers…

Hi all,

I’m using SonarQubde devel edition 7.3. My project is C/C++ and I’d like to upload generic coverage data to the server. Currently I’m failing with the server showing no cov.

My project layout is like this:

root/
    src/ build/

The sonar settings are:

sonar.sources=src

I run the scanner with the following args:

-Dproject.settings=config/sonar/sonar-project.properties -Dsonar.projectBaseDir=. -Dsonar.coverageReportPaths=myreport.xml

(where . is the root/)

I have code coverage data in the following form:

<?xml version='1.0' encoding='UTF-8'?>
<coverage version="1">
    <file path="src/audio/modules/AGC/AGC_float.c">
        <lineToCover lineNumber="100" covered="false"/>
         ....

So I think the paths in the cov XML file are right (they start by src/, which is exactly how Sonar shows them in the web UI (“Code tab”)).

Unfortunately I get 0 coverage data in the UI. Can you help me with this ?

Thank you.

On an administrative note, two threads were created on two different days. I’ve moved the older one here to the thread I had already responded too.

Thank you, I was searching for my first post with no success. I thought I did not really post it :confused:

I finally managed to get the results on Sonar. Not sure what was really the problem (may be sent the results of the build that did not contain cov data …)

Hi,

I’m glad you worked through this. Sorry your posts initially fell through the cracks.

 
Ann