Skip to content

ExcludeFromCoverage method annotation does not exclude common forms of compiler generated code #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SteveGilham opened this issue May 3, 2018 · 3 comments

Comments

@SteveGilham
Copy link

SteveGilham commented May 3, 2018

In the following C# class I exercise the static method Normal and exclude pretty much everything else with [ExcludeFromCoverage]; the annotation takes for the simple method Canary, but essentially none of the other methods. In the F# code below it (linking the same coverage exclusion attribute), nested functions, lambdas and computation expressions are all still included.

cv82

cv82-bis
cv82a

@SteveGilham
Copy link
Author

It should also come as no surprise that C#7.0 local functions are similarly not excluded even if the enclosing method is.

@tonerdo
Copy link
Collaborator

tonerdo commented May 5, 2018

Thanks for reporting this. Definitely an oversight, will look into a fix. Any ideas you might have a welcome

@SteveGilham
Copy link
Author

In the C# case, at least, the synthetic name contains the name of the lexically surrounding function in angle-brackets. Where there isn't an overload of that method name, that will do the job. Overloads are going to be trickier to resolve.

azabluda added a commit to azabluda/InfoCarrier.Core that referenced this issue May 26, 2018
…/coverlet#82

Add own methods in InfoCarrier.Core.Common.Utils (slightly simplified according to limited needs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants