Coverage exclusion in Eclipse [EclEmma] is not working?

拜拜、爱过 提交于 2019-12-02 08:32:06

I think there is misunderstanding about how these fields currently work, because

However, while the "includes" field works just as described, the "excludes" field does not.

this statement about "includes" field is incorrect as even shown on your screenshot - while only audio.* and linguistics.* are included, there are other packages in a report.

And here is why: these fields are about "Coverage Runtime" and correspond to respective options of JaCoCo agent - they allow to specify classes whose bytecode will be modified, they do not include/exclude classes from generation of report. Classes whose bytecode wasn't modified will be presented in report with "0%". Such specification is useful for the rare cases when bytecode modification interferes with code under test as stated in cited by you documentation:

For technical reasons it might be necessary to exclude certain classes from code coverage analysis. The following options configure the coverage agent to exclude certain classes from analysis. Except for performance optimization or technical corner cases these options are normally not required.

and few lines below:

Warning: ... Excluded classes will still show as not covered.

And so yes - there is still no exclusions for report.

However, this problem is well over a year old.

Eclipse EclEmma Project is open-source, so feel free to implement this feature and contribute back.

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