This is what is done in the examples above, inside the build.yml files of each example. On the command line of the scanner invocation use the -D or -define switch.Coverage parameters can be set in multiple placesĪs with other analysis parameters, the coverage-related parameters for C/C++/Objective-C projects can be set in multiple places: For information on the popular commercial Bullseye product, see. These examples include the major free-to-use coverage tools for C/C++/Objective-C (VS Coverage, XCode Coverage, LLVM-COV, GCOVR, and GCOV). Visual Studio Coverage example on Azure DevOps.Visual Studio Coverage example on GitHub Actions.These examples do not explicitly describe every possible combination of tooling and platform but do cover the most significant variants. In the same GitHub organization, you will also find example repositories that provide guidance on how to add coverage to an already-configured project. Īssuming that you have already set up your project, you will have seen the example projects ( without coverage) referenced in the in-product tutorials: sonarsource-cfamily-examples.Each has an associated analysis parameter that must be set to the location of the coverage report that is produced by the tool. Configure the scanning step of your build so that the scanner picks up the report file from that defined path.įor C/C++/Objective-C projects, SonarQube supports a number of coverage tools.Make sure that the coverage tool writes its report file to a defined path in the build environment.This is done just after your unit tests as part of the clean build required to run analysis. Adjust your build process so that the coverage tool generates the report(s).You then need to configure your analysis to tell the SonarScanner where the report is located so that it can pick it up and send it to SonarQube, where it will be displayed on your project dashboard along with the other analysis metrics. Instead, you must set up a third-party tool to produce the report as part of your build process. However, SonarQube does not generate the coverage report itself. ![]() SonarQube supports the reporting of test coverage information as part of the analysis of your C/C++/Objective-C project.
0 Comments
Leave a Reply. |