如何使用 jacoco.exec 报告 [英] how to use jacoco.exec report
问题描述
我从 jacoco 生成了一个代码覆盖率报告,它是 jacoco.exec.但是不知道怎么用...
I generated a code coverage report from jacoco, which is jacoco.exec. But I don't know how to use it ...
我生成它的方式是通过命令行:
The way I generated it is through command line:
java -javaagent:/path/to/jacocoagent.jar=include=some.package.*,output=file org.junit.runner.JUnitCore some.package.ClassTest
然后我得到了 jacoco.exec 报告.我所需要的只是百分比的数量,而且我只使用命令行.有没有办法把这个报告转换成可读的txt文件?
Then I got the jacoco.exec report. All I need is just the number of percentage, and I am using command line only. Is there a way to convert this report to a readable txt file?
谢谢大家
推荐答案
In IntelliJ Idea 从菜单中选择 Analyze
>显示覆盖数据
.在新窗口中按 + 按钮并选择您的 .exec 文件.测试覆盖率结果将显示在编辑器 Coverage 选项卡中.
In IntelliJ Idea from the menu select Analyze
> Show Coverage data
. In the new window press the + button and select your .exec file.
The test coverage results will appear in the editor Coverage tab.
在最新版本的 Intellij Idea 中,菜单已移至 Run
>显示代码覆盖率数据
In the latest version of Intellij Idea the menu has been moved to Run
> Show Code Coverage Data
这篇关于如何使用 jacoco.exec 报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!