Check code coverage | Qt Creator Documentation

- Qt Creator Documentation
- Check code coverage
- Qt Creator 15.0.0

How To

# Check code coverage

With Coco CoverageBrowser, you can analyze the test coverage by loading an instrumentation database (a .csmes file), which was generated by Coco CoverageScanner. The experimental Coco plugin is currently supported only on Windows, with Coco version 6.0, or later.

To use the plugin, you must download and install Coco.

Note: Enable the Coco plugin to use it.

## Configure Coco

1. Go to Analyze > Squish Coco.

2. In CoverageBrowser, enter the path to the Coco coverage browser to use for analyzing a .csmes file.
3. In CSMes, select the instrumentation database to load.
4. Select Open to start CoverageBrowser.
5. In CoverageBrowser, go to File > Load Execution Report and select the .csexe for the coverage scan.

6. To keep the execution report, clear Delete execution report after loading.

Open the analyzed files in Qt Creator. You can see the results of the analysis after the code in Edit mode. You can change the fonts and colors used for different types of results.

## Changing Fonts and Colors

To change the default fonts and colors, go to Preferences > Text Editor > Font & Colors. Create your own color scheme and select new fonts and colors for the following results:

- Code Coverage Added Code
- Partially Covered Code
- Uncovered Code
- Fully Covered Code
- Manually Validated Code
- Code Coverage Dead Code
- Code Coverage Execution Count too Low
- Implicitly Not Covered Code
- Implicitly Covered Code
- Implicit Manual Coverage Validation

See also Enable and disable plugins, How To: Analyze, Analyzers, Font & Colors, and Analyzing Code.

How To