|
| 1 | +Supports **.NET Core** projects and **.NET Framework** projects. |
| 2 | + |
| 3 | +Feedback and ideas are welcome [click here to let me know](https://github.com/FortuneN/FineCodeCoverage/issues) |
| 4 | + |
| 5 | +### <a href="https://www.youtube.com/watch?v=Rae5bTE2D3o" target="_blank">Watch Introduction Video</a> |
| 6 | + |
| 7 | +## Highlights unit test code coverage |
| 8 | +Run a(some) unit test(s) and ... |
| 9 | + |
| 10 | +#### Get highlights on the code being tested |
| 11 | + |
| 12 | + |
| 13 | +#### Get highlights on the code doing the testing |
| 14 | + |
| 15 | + |
| 16 | +#### See Coverage View |
| 17 | + |
| 18 | + |
| 19 | +#### See Summary View |
| 20 | + |
| 21 | + |
| 22 | +#### See Risk Hotspots View |
| 23 | + |
| 24 | + |
| 25 | +#### Global (Shared) options |
| 26 | + |
| 27 | + |
| 28 | +#### Local (Project) options (override globals in your csproj/vbproj : OPTIONAL) |
| 29 | +``` |
| 30 | +<PropertyGroup Label="FineCodeCoverage"> |
| 31 | + <Enabled> |
| 32 | + True |
| 33 | + </Enabled> |
| 34 | + <Exclude> |
| 35 | + [ThirdParty.*]* |
| 36 | + [FourthParty]* |
| 37 | + </Exclude> |
| 38 | + <Include> |
| 39 | + [*]* |
| 40 | + </Include> |
| 41 | + <ExcludeByFile> |
| 42 | + **/Migrations/* |
| 43 | + **/Hacks/*.cs |
| 44 | + </ExcludeByFile> |
| 45 | + <ExcludeByAttribute> |
| 46 | + MyCustomExcludeFromCodeCoverage |
| 47 | + </ExcludeByAttribute> |
| 48 | + <IncludeTestAssembly> |
| 49 | + True |
| 50 | + </IncludeTestAssembly> |
| 51 | +</PropertyGroup> |
| 52 | +``` |
| 53 | + |
| 54 | +#### Options |
| 55 | +``` |
| 56 | +Enabled Specifies whether or not coverage output is enabled |
| 57 | +Exclude Filter expressions to exclude specific modules and types (multiple values) |
| 58 | +Include Filter expressions to include specific modules and types (multiple values) |
| 59 | +ExcludeByFile Glob patterns specifying source files to exclude e.g. **/Migrations/* (multiple values) |
| 60 | +ExcludeByAttribute Attributes to exclude from code coverage (multiple values) |
| 61 | +
|
| 62 | +Both 'Exclude' and 'Include' options can be used together but 'Exclude' takes precedence. |
| 63 | +
|
| 64 | +You can ignore a method or an entire class from code coverage by creating and applying the [ExcludeFromCodeCoverage] attribute present in the System.Diagnostics.CodeAnalysis namespace. |
| 65 | +You can also ignore additional attributes by adding to the 'ExcludeByAttributes' list (short name or full name supported) e.g. : |
| 66 | +[GeneratedCode] => Present in System.CodeDom.Compiler namespace |
| 67 | +[MyCustomExcludeFromCodeCoverage] => Any custom attribute that you may define |
| 68 | +``` |
| 69 | + |
| 70 | +#### Filter Expressions |
| 71 | +``` |
| 72 | +Wildcards |
| 73 | +* => matches zero or more characters |
| 74 | + |
| 75 | +Examples |
| 76 | +[*]* => All types in all assemblies (nothing is instrumented) |
| 77 | +[coverlet.*]Coverlet.Core.Coverage => The Coverage class in the Coverlet.Core namespace belonging to any assembly that matches coverlet.* (e.g coverlet.core) |
| 78 | +[*]Coverlet.Core.Instrumentation.* => All types belonging to Coverlet.Core.Instrumentation namespace in any assembly |
| 79 | +[coverlet.*.tests]* => All types in any assembly starting with coverlet. and ending with .tests |
| 80 | +
|
| 81 | +Both 'Exclude' and 'Include' options can be used together but 'Exclude' takes precedence. |
| 82 | +``` |
| 83 | + |
| 84 | +## Contribute |
| 85 | +Check out the [contribution guidelines](https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/master/CONTRIBUTING.md) |
| 86 | +if you want to contribute to this project. |
| 87 | + |
| 88 | +For cloning and building this project yourself, make sure |
| 89 | +to install the |
| 90 | +[Extensibility Tools 2015](https://visualstudiogallery.msdn.microsoft.com/ab39a092-1343-46e2-b0f1-6a3f91155aa6) |
| 91 | +extension for Visual Studio which enables some features |
| 92 | +used by this project. |
| 93 | + |
| 94 | +## License |
| 95 | +[Apache 2.0](https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/master/LICENSE) |
| 96 | + |
| 97 | +## Credits |
| 98 | +[Coverlet](https://github.com/coverlet-coverage/coverlet) |
| 99 | + |
| 100 | +[OpenCover](https://github.com/OpenCover/opencover) |
| 101 | + |
| 102 | +[ReportGenerator](https://github.com/danielpalme/ReportGenerator) |
| 103 | + |
| 104 | +## Please support the project |
| 105 | +| Provider | Type | Link | |
| 106 | +|:---------|:---------:|:---------------------------------------------------------------------------------------------------------------------------------:| |
| 107 | +| Paypal | Once | [<img src="https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-100px.png">](https://paypal.me/FortuneNgwenya) | |
| 108 | +| Librepay | Recurring | [<img alt="Donate using Liberapay" src="https://raw.githubusercontent.com/FortuneN/FineCodeCoverage/master/Art/librepay.png">](https://liberapay.com/FortuneN/donate) | |
0 commit comments