Skip to content
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

Avoid to instrument compiler generated code when generated from excluded methods #671

Merged

Conversation

matteoerigozzi
Copy link
Contributor

@matteoerigozzi matteoerigozzi commented Dec 27, 2019

Fix #129
Fix #670

Change instrumenter to keeping track of methods with ExcludeFromCodeCoverage attribute and exclude compiler-generated code for lamda, yield, async/await and local functions.

Check here
https://github.com/dotnet/roslyn/blob/1fcbc51/src/Compilers/CSharp/Portable/Symbols/Synthesized/GeneratedNames.cs
for compiler synthesized names.

@MarcoRossignoli MarcoRossignoli added bug Something isn't working tenet-coverage Issue related to possible incorrect coverage labels Dec 27, 2019
@MarcoRossignoli
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MarcoRossignoli
Copy link
Collaborator

Some test fail, they seems a bit flaky, one time fails on debug and other time on release, maybe we should try to find something more stable.

@matteoerigozzi matteoerigozzi changed the title Avoid to instrument compiler generated code when generated from excluded methods [WIP] Avoid to instrument compiler generated code when generated from excluded methods Jan 10, 2020
@matteoerigozzi
Copy link
Contributor Author

matteoerigozzi commented Jan 13, 2020

Fix #670

@matteoerigozzi matteoerigozzi changed the title [WIP] Avoid to instrument compiler generated code when generated from excluded methods Avoid to instrument compiler generated code when generated from excluded methods Jan 13, 2020
@MarcoRossignoli
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MarcoRossignoli
Copy link
Collaborator

@matteoerigozzi I did some small updates+add documentation can you take a look?

Copy link
Collaborator

@MarcoRossignoli MarcoRossignoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@MarcoRossignoli
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@MarcoRossignoli MarcoRossignoli merged commit 767dfb1 into coverlet-coverage:master Jan 14, 2020
@MarcoRossignoli MarcoRossignoli mentioned this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tenet-coverage Issue related to possible incorrect coverage
Projects
None yet
2 participants