EMMA 覆盖率工具不显示逐行覆盖率
我正在使用 EMMA 工具进行代码覆盖,但尽管我尽了最大努力,EMMA 仍拒绝查看原始 .java 文件并逐行生成覆盖范围。
我们使用 ANT 构建代码并将 debug 设置为 true。 我知道 EMMA 正在测量覆盖范围,因为 .emma 文件似乎正在正确生成和合并。 这些报告能够以百分比呈现高水平的方法覆盖率。
但为什么它看不到 .java 文件呢? 我得到的只是: [在源路径中找不到源文件“a/b/c/d/e/f/code.java”]
I am using the EMMA tool for code coverage yet despite my best efforts, EMMA is refusing to see the original .java files and generate coverage on a line-by-line basis.
We are using ANT to build the code and debug is set to true. I know that EMMA is measuring coverage as the .emma files seem to be generating and merging correctly. The reports are able to present high level method coverage with percentages.
But why won't it see the .java files? All I get is:
[source file 'a/b/c/d/e/f/code.java' not found in sourcepath]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您是否在
report
元素中设置sourcepath
?Are you setting the
sourcepath
in yourreport
element?您能否发布
build.xml
中生成EMMA
报告的部分? 听起来像是报告源路径
问题。report sourcepath
应指向您的java 源。请参阅 EMMA 参考中的源路径。 这可以是类似路径的结构,因此您可以包含多个源目录。
与往常一样,使用 ANT:
-verbose
-debug
执行尽可能最小的 build.xmlCould you post the portion of your
build.xml
that generates theEMMA
reports? Sounds like areport sourcepath
issue.report sourcepath
should point to your java source.See sourcepath in the EMMA reference. This can be a path-like structure, so you can include multiple source directories.
As always, with ANT:
-verbose
-debug
for even more information.我遇到了同样的问题。 但发现在设置源路径时我们需要设置为唯一的目录级别而不是java文件位置。 它类似于类路径
I ran into the same issue. But found that while setting the sourcepath we need to set to the only directory level not to the java file location. it is similar to the classpath
{java.src.dir}
是否需要指向一个特定的src
目录。这不是一个单一的 src 目录,因为我正在编译多个项目。 每个都有自己的 build.xml 文件。
我相信这是生成所有覆盖率报告的部分:
编辑:我更改了源路径以直接指向 src 目录之一。 看看是否有效。
does
{java.src.dir}
need to point to one specificsrc
directory.This is no one single src directory as I am compiling multiple projects. Each with their own build.xml file.
I believe this is the portion that generates all the coverage reports:
EDIT: I changed the sourcepath to point directly to one of the src directories. See if that works.