it looks like Bazel generates coverage report in bazel-out/_coverage/_coverage_report.dat.
When I tried to use this coverage report in sonar using sonar.coverageReportPaths, it shows
19:20:50.743 INFO: Sensor Generic Coverage Report
19:20:50.743 INFO: Parsing /builds/repo/bazel-out/_coverage/_coverage_report.dat
19:20:50.813 INFO: ------------------------------------------------------------------------
19:20:50.813 INFO: EXECUTION FAILURE
19:20:50.813 INFO: ------------------------------------------------------------------------
19:20:50.813 INFO: Total time: 4:28.604s
19:20:50.951 ERROR: Error during SonarScanner execution
Error during parsing of the generic coverage report '/builds/nsx-allspark_users/m7/envoy-filters/bazel-out/_coverage/_coverage_report.dat'. Look at SonarQube documentation to know the expected XML format.
Are there any additional steps that need to be followed?
sonar info:
Thanks for the reply. Is there a way to use that bazel coverage report in sonar? Somehow format/parse the file to XML based or covert the report to whichever format(llvm-cov) supported by sonar?
Because I’m having more than 200 files under diff sub-directories.
Is there any single line command in llvm-cov, to generate a coverage report by just mentioning the src (root) folder
If you check the CMAKE file add_executable(coverage_test1 src/lib.cpp src/test1.cpp) they added the files for code coverage. In my case I have more than 200+ files for which a coverage report needs to generated. Should I have to add these here? Is there any option to directly point the directory and generate report?
this line has nothing to do with coverage. This means that the build should produce an executable named coverage_test1 from the compilation of src/lib.cpp and src/test1.cpp.