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

Exclude by assembly level System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage #589

Conversation

MarcoRossignoli
Copy link
Collaborator

@MarcoRossignoli MarcoRossignoli added the feature-request New feature request label Oct 12, 2019
@MarcoRossignoli MarcoRossignoli changed the title Exclude by assembly level System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage [WIP]Exclude by assembly level System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage Oct 12, 2019
@MarcoRossignoli MarcoRossignoli changed the title [WIP]Exclude by assembly level System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage Exclude by assembly level System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage Oct 12, 2019
@MarcoRossignoli
Copy link
Collaborator Author

Manual test
No attribute

F:\git\coverletissues\testpr589
λ dotnet test /p:CollectCoverage=true /bl
C:\Program Files\dotnet\sdk\3.0.100\MSBuild.dll -nologo -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\3.0.100\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\3.0.100\dotnet.dll -maxcpucount -nodereuse:false -restore -target:VSTest -verbosity:m -verbosity:quiet /bl /p:CollectCoverage=true .\testpr589.sln
Test run for F:\git\coverletissues\testpr589\bin\Debug\netcoreapp3.0\testpr589.dll(.NETCoreApp,Version=v3.0)
Microsoft (R) Test Execution Command Line Tool Version 16.3.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

A total of 1 test files matched the specified pattern.

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 1,1008 Seconds

Calculating coverage result...
  Generating report 'F:\git\coverletissues\testpr589\coverage.json'

+---------------+------+--------+--------+
| Module        | Line | Branch | Method |
+---------------+------+--------+--------+
| ClassLibrary1 | 100% | 100%   | 100%   |
+---------------+------+--------+--------+
| ClassLibrary2 | 100% | 100%   | 100%   |
+---------------+------+--------+--------+

+---------+------+--------+--------+
|         | Line | Branch | Method |
+---------+------+--------+--------+
| Total   | 100% | 100%   | 100%   |
+---------+------+--------+--------+
| Average | 100% | 100%   | 100%   |
+---------+------+--------+--------+

image

With attribute [assembly: ExcludeFromCodeCoverage] on ClassLibrary2

F:\git\coverletissues\testpr589
λ dotnet test /p:CollectCoverage=true /bl
C:\Program Files\dotnet\sdk\3.0.100\MSBuild.dll -nologo -distributedlogger:Microsoft.DotNet.Tools.MSBuild.MSBuildLogger,C:\Program Files\dotnet\sdk\3.0.100\dotnet.dll*Microsoft.DotNet.Tools.MSBuild.MSBuildForwardingLogger,C:\Program Files\dotnet\sdk\3.0.100\dotnet.dll -maxcpucount -nodereuse:false -restore -target:VSTest -verbosity:m -verbosity:quiet /bl /p:CollectCoverage=true .\testpr589.sln
Test run for F:\git\coverletissues\testpr589\bin\Debug\netcoreapp3.0\testpr589.dll(.NETCoreApp,Version=v3.0)
Microsoft (R) Test Execution Command Line Tool Version 16.3.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...

A total of 1 test files matched the specified pattern.

Test Run Successful.
Total tests: 1
     Passed: 1
 Total time: 1,0850 Seconds

Calculating coverage result...
  Generating report 'F:\git\coverletissues\testpr589\coverage.json'

+---------------+------+--------+--------+
| Module        | Line | Branch | Method |
+---------------+------+--------+--------+
| ClassLibrary1 | 100% | 100%   | 100%   |
+---------------+------+--------+--------+

+---------+------+--------+--------+
|         | Line | Branch | Method |
+---------+------+--------+--------+
| Total   | 100% | 100%   | 100%   |
+---------+------+--------+--------+
| Average | 100% | 100%   | 100%   |
+---------+------+--------+--------+

image

@MarcoRossignoli MarcoRossignoli merged commit 83c47b8 into coverlet-coverage:master Oct 12, 2019
@MarcoRossignoli MarcoRossignoli deleted the excludefromcodecoverage branch October 12, 2019 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assembly marked as ExcludeFromCodeCoverage is not excluded
1 participant