According to this post on StackOverflow and EclEmma's documentation, exclusion of classes from the coverage should be very possible. However, while the "includes" field works just as described, the "excludes" field does not.
Take the following project hierarchy and coverage runtime settings respectively:
But, after running the coverage operation, the exclude setting does not work:
As one can see, the excluded package is still being included in the overall coverage testing. In addition, if you mark '*' in "includes" and mark a package in the "excludes," it is still not excluded.
According to this issue and Godlin's answer:
Unfortunately currently EclEmma does not support exclusions from the report as stated in [issue]
However, this problem is well over a year old. I am asking if I am doing something incorrect or if this problem is still ongoing? What is the point of including these two fields if they don't work as intended?
Version(s):
Eclipse: Oxygen Release (4.7.0)
I think there is misunderstanding about how these fields currently work, because
this statement about "includes" field is incorrect as even shown on your screenshot - while only
audio.*
andlinguistics.*
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:
and few lines below:
And so yes - there is still no exclusions for report.
Eclipse EclEmma Project is open-source, so feel free to implement this feature and contribute back.