I have gcda files which are generated from a c program file. So which path should be added in sonar file I have all those files in Repo
Hey there.
If you’re using gcov, you should point sonar.cfamily.gcov.reportsPath
to the directory containing your .gcov
reports, as documented.
Hi Colin Thanks for the Response . Actually i have
those folder structure i need to generate a report in sonarqube for code coverage
I am not able to add what are the key terms to be added to generate a report
You’’ll need to use something like gcovr
to convert these files into a format SonarQube will read.
The ‘gcov’ tool turns raw coverage files (.gcda and .gcno) into .gcov files that are then processed by gcovr. The gcno files are generated by the compiler. The gcda files are generated when the instrumented program is executed.
Yes I have installed gcov in my System and i am using the command to generate the report is “gcovr -r . --xml > coverage.xml” i have gcda, gcno and program.c files in my local system. i was getting an error : Stdout of gcov was >>None<< End of stdout
Stderr of gcov was >>None<< End of stderr
Exception was >>GCOV returncode was 5.
Stdout of gcov was >>File ‘../source/afl_task.c’
Lines executed:0.00% of 129
Branches executed:0.00% of 58
Taken at least once:0.00% of 58
Calls executed:0.00% of 24
Creating ‘afl_task.c##1b456c57384f49df7645202a2a32efd8.gcov’
Am i missing anything here
I was assuming this errors could be different time Stamp files has been created
Hi there,
You might want to try running gcovr with the --verbose flag
to get more detailed error messages. If that doesn’t help, doing a clean rebuild and retest of your project often resolves these sorts of issues.
Keep in mind that in this community, we’re generally focused on interpreting coverage reports, not generating them. SonarQube simply reads the coverage files you provide—it doesn’t generate them itself. For help generating the reports, you may find more targeted advice in forums specific to your build tools or gcovr.