从 Coco 查看代码覆盖率报告
注意: 启用 Coco 插件才能使用。
使用 Coco CoverageBrowser,您可以通过加载由 Coco CoverageScanner 生成的工具数据库(.csmes
文件)来分析测试覆盖率。
有关如何在Qt Creator 中为代码覆盖率设置项目的更多信息,请参阅从 Coco 设置代码覆盖率。
测量和检查代码覆盖率:
- 访问Analyze >Squish Coco 。
- 在CSMes file 中,选择要加载的仪器数据库。
- 选择Open 启动 CoverageBrowser。
- 在 CoverageBrowser 中,转到File >Load Execution Report ,选择
.csexe
文件进行覆盖率扫描。 - 要保留执行报告,请清除Delete execution report after loading 。
在Qt Creator 中打开分析过的文件。在Edit 模式下,您可以在代码后看到分析结果。您可以更改不同类型结果所使用的字体和颜色。
禁用查看代码覆盖率Qt Creator
在Analyze >Squish Coco 中设置仪器数据库后,每次启动Qt Creator 时,CoverageBrowser 都会自动启动。要禁用此功能,请将CSMes file 的内容替换为空字符串。
更改字体和颜色
要更改默认字体和颜色,请访问首选项>Text Editor >Font & Colors 。创建自己的配色方案并选择新的字体和颜色,结果如下:
- 代码覆盖范围 已添加代码
- 部分覆盖代码
- 未覆盖代码
- 完全覆盖代码
- 手动验证代码
- 代码覆盖 死代码
- 代码覆盖 执行计数过低
- 隐含未覆盖代码
- 隐式覆盖代码
- 隐式手动覆盖验证
另请参阅 启用和禁用插件、从 Coco 设置代码覆盖、字体和颜色以及分析代码。
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.