I have configured EclEmma not to instrument my unit tests which works fine. However, the editor still highlights the test code as not covered. I want no highlighting in unit tests because they are not instrumented to detect coverage. How can I do this?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I did this in Preferences->Java->Code Coverage and set the "Only path entries matching" option to src/main/java
- seems to work nicely.
回答2:
The include/exclude filter settings in the Preferences window apply to class name/package patterns for all projects. To control the files at the folder/path level you must set it per-project.
- Right-click the project
- Select Coverage As | Coverage Configurations...
- Select the project under the Junit subtree
- Select the Coverage tab on the right
- Uncheck the folder containing your tests, e.g.,
src/test/java
- Click Apply
- Click Close (or Coverage to run immediately)
These settings will apply every time you run the coverage in the future without having to open the configuration window.