EclEmma代码覆盖率忽略Junit测试 [英] EclEmma Code Coverage Ignore Junit Tests

查看:275
本文介绍了EclEmma代码覆盖率忽略Junit测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现不在我的JUnit测试中检查代码覆盖率的唯一方法是右键单击该程序包,选择Coverage as ...,然后选择配置.然后,我可以取消我的测试包.我已经尝试了每种可能的组合,以排除一般偏好/java/code coverage/exclude下的 test ,并且没有看到任何变化.我总是将测试放在与包src代码相同的包名称的单独测试源文件夹中.

The only way I have found to not check code coverage on my JUnit tests is to right click on the package, choose Coverage as..., and then choose configuration. Then I can unclick my test package. I have tried every possible combination to exclude test under the general preferences/java/code coverage/exclude and not seen any changes. I always put my tests in a separate test source folder with the same package name as my src code.

我真的必须配置每个项目以忽略我的JUnit测试吗?这似乎是多余的.为什么有人要检查测试范围?

Do I really have to configure every single project to ignore my JUnit tests? This seems redundant. Why would anyone want to check the coverage of their tests?

推荐答案

用逗号分隔的字符串列表,必须与类路径条目匹配.如果类路径条目包含给定的字符串之一,则它与过滤器匹配. (例如"src/main/java",默认值:无过滤器)

Comma separated list of strings that must match with the class path entry. A class path entry matches the filter, if it contains one of the given strings. (e.g. "src/main/java", Default: no filter)

将其设置为src/main/java并运行src/test/java中的测试后:

After setting it to src/main/java and running test that is located in src/test/java:

这篇关于EclEmma代码覆盖率忽略Junit测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆