如何使用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?
谢谢所有
推荐答案
在IntelliJ Idea中从菜单中选择分析
> 显示覆盖率数据
。在新窗口中,按+按钮,然后选择您的.exec文件。
测试覆盖率结果将显示在编辑器的覆盖率选项卡中。
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中,菜单具有已移至运行
> 显示代码覆盖率数据
In the latest version of Intellij Idea the menu has been moved to Run
> Show Code Coverage Data
这篇关于如何使用jacoco.exec报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!