Atlassian clove for IDEA的使用
2017-08-16 本文已影响39人
ahtest
用于查检单元测试的代码覆盖率的
1. 安装
File > Settings > Plugins > Browse repositories
输入'Atlassian Clover for IDEA' 点击 'Install',重新启动idea

2. 申请clover的free license(30-day)
File > Settings > Build, Execution, Deployment > Clover(global settings) > License
点击“generate an evaluation license”,打开atlassian网站

3. 申请license
要先确保在atlassian有帐户,选择product为clover,点击[Generate License]

复制license,粘贴到IDEA中,点击[Verify],验证通过,会显示license的过期时间


重启动后,项目的左边多两标签 cloverage和test runs

4. Clover的使用
将鼠标放到要进行覆盖率统计的代码文件或文件夹上右击,点击”change Exclusion”,选择include,测试代码也要include,才能统计出测试结果。

5. 运行测试脚本
运行测试脚本

6. 查看结果
点击cloverage标签,查看代码覆盖情况

点击左侧test runs,进行查看测试结果

7. 导出Clover报告
在cloveraged面板中,点击”generate clover report”导出报告

