用于查检单元测试的代码覆盖率的
1. 安装
File > Settings > Plugins > Browse repositories
输入'Atlassian Clover for IDEA' 点击 'Install',重新启动idea
Paste_Image.png
2. 申请clover的free license(30-day)
File > Settings > Build, Execution, Deployment > Clover(global settings) > License
点击“generate an evaluation license”,打开atlassian网站
Paste_Image.png
3. 申请license
要先确保在atlassian有帐户,选择product为clover,点击[Generate License]
Paste_Image.png
复制license,粘贴到IDEA中,点击[Verify],验证通过,会显示license的过期时间
Paste_Image.png
Paste_Image.png
重启动后,项目的左边多两标签 cloverage和test runs
Paste_Image.png
4. Clover的使用
将鼠标放到要进行覆盖率统计的代码文件或文件夹上右击,点击”change Exclusion”,选择include,测试代码也要include,才能统计出测试结果。
Paste_Image.png
5. 运行测试脚本
运行测试脚本
Paste_Image.png
6. 查看结果
点击cloverage标签,查看代码覆盖情况
Paste_Image.png
点击左侧test runs,进行查看测试结果
Paste_Image.png
7. 导出Clover报告
在cloveraged面板中,点击”generate clover report”导出报告
Paste_Image.png
Paste_Image.png