EclEmma Code Coverage Ignore Junit Tests

末鹿安然 提交于 2019-12-13 15:12:59

问题


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.

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?


回答1:


There is option Only path entries matching in Preferences -> Java -> Code Coverage that is described in documentation at http://www.eclemma.org/userdoc/preferences.html:

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)

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




回答2:


ECLEmma just excludes those files which are excluded , but it does not create creating coverage report and giving 0% coverage for that file , generating report

Finally ECL Emma not supporting this.



来源:https://stackoverflow.com/questions/38779652/eclemma-code-coverage-ignore-junit-tests

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!