Skip to content

Commit 451e157

Browse files
committed
readme table
1 parent e475ed1 commit 451e157

File tree

1 file changed

+84
-81
lines changed

1 file changed

+84
-81
lines changed

README.md

Lines changed: 84 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -228,104 +228,107 @@ If you are using option 1) then project and global options will only be used whe
228228

229229

230230
#### Options
231-
```
232-
*** Common
233-
CoverageColoursFromFontsAndColours Specify true to use Environment / Fonts and Colors / Text Editor for editor Coverage colouring ( if present).
234-
Coverage Touched Area / Coverage Not Touched Area / Coverage Partially Touched Area.
235-
When false colours used are Green, Red and Gold.
231+
|Option |Description|
232+
|--|---|
233+
|**Common**||
234+
|CoverageColoursFromFontsAndColours|Specify true to use Environment / Fonts and Colors / Text Editor for editor Coverage colouring ( if present). Coverage Touched Area / Coverage Not Touched Area / Coverage Partially Touched Area. When false colours used are Green, Red and Gold.|
235+
|ShowCoverageInOverviewMargin|Set to false to prevent coverage marks in the overview margin|
236+
|ShowCoveredInOverviewMargin|Set to false to prevent covered marks in the overview margin|
237+
|ShowUncoveredInOverviewMargin|Set to false to prevent uncovered marks in the overview margin|
238+
|ShowPartiallyCoveredInOverviewMargin|Set to false to prevent partially covered marks in the overview margin|
239+
|ShowToolWindowToolbar|Set to false to hide the toolbar on the tool window. Requires restarting Visual Studio. The toolbar has buttons for viewing the Cobertura xml and the risk hotspots.|
240+
|FCCSolutionOutputDirectoryName|To have fcc output visible in a sub folder of your solution provide this name|
241+
|ToolsDirectory|Folder to which copy tools subfolder. Must alredy exist. Requires restart of VS.|
242+
|ThresholdForCyclomaticComplexity| When [cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) exceeds this value for a method then the method will be present in the risk hotspots tab. |
243+
|StickyCoverageTable|Set to true for coverage table to have a sticky thead.|
244+
|NamespacedClasses|Set to false to show classes in report in short form. Affects grouping.|
245+
|HideFullyCovered|Set to true to hide classes, namespaces and assemblies that are fully covered.|
246+
|Hide0Coverage|Set to true to hide classes, namespaces and assemblies that have 0% coverage.|
247+
|Hide0Coverable|Set to false to show classes, namespaces and assemblies that are not coverable.|
248+
|Enabled|Specifies whether or not coverage output is enabled|
249+
|RunWhenTestsFail|By default coverage runs when tests fail. Set to false to prevent this. **Cannot be used in conjunction with RunInParallel**|
250+
|RunWhenTestsExceed|Specify a value to only run coverage based upon the number of executing tests. **Cannot be used in conjunction with RunInParallel**|
251+
|RunMsCodeCoverage|Change to IfInRunSettings to only collect with configured runsettings. Yes for runsettings generation.|
252+
|IncludeTestAssembly|Specifies whether to report code coverage of the test assembly|
253+
|IncludeReferencedProjects|Set to true to add all directly referenced projects to Include.|
254+
|IncludeAssemblies|Provide a list of assemblies to include in coverage. The dll name without extension is used for matching.|
255+
|ExcludeAssemblies| Provide a list of assemblies to exclude from coverage. The dll name without extension is used for matching.|
256+
|<br>||
257+
|**OpenCover / Coverlet**||
258+
|AdjacentBuildOutput|If your tests are dependent upon their path set this to true.|
259+
|Exclude|Filter expressions to exclude specific modules and types (multiple values)|
260+
|Include|Filter expressions to include specific modules and types (multiple values)|
261+
|ExcludeByFile|Glob patterns specifying source files to exclude e.g. **/Migrations/* (multiple values)|
262+
|ExcludeByAttribute|Attributes to exclude from code coverage (multiple values)|
263+
|RunInParallel|By default OpenCover / Coverlet tests run and then coverage is performed. Set to true to run coverage immediately|
264+
|<br>||
265+
|**Ms code coverage**|Each of below is an array of regexes to be transformed into runsettings elements [see](https://learn.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis?view=vs-2022#include-or-exclude-assemblies-and-members)|
266+
|ModulePathsExclude|Exclude - Matches assemblies specified by assembly name or file path.|
267+
|ModulePathsInclude|Include - Matches assemblies specified by assembly name or file path.|
268+
|CompanyNamesExclude|Exclude - Matches assemblies by the Company attribute.|
269+
|CompanyNamesInclude|Include - Matches assemblies by the Company attribute.|
270+
|PublicKeyTokensExclude|Exclude - Matches signed assemblies by the public key token.|
271+
|PublicKeyTokensInclude|Include - Matches signed assemblies by the public key token.|
272+
|SourcesExclude|Exclude - Matches elements by the path name of the source file in which they're defined.|
273+
|SourcesInclude|Include - Matches elements by the path name of the source file in which they're defined.|
274+
|AttributesExclude|Exclude - Matches elements that have the specified attribute. Specify the full name of the attribute|
275+
|AttributesInclude|Include - Matches elements that have the specified attribute. Specify the full name of the attribute|
276+
|FunctionsExclude|Exclude - Matches procedures, functions, or methods by fully qualified name, including the parameter list.|
277+
|FunctionsInclude|Include - Matches procedures, functions, or methods by fully qualified name, including the parameter list.|
278+
|<br>||
279+
|**Coverlet**||
280+
|RunSettingsOnly|Specify false for global and project options to be used for coverlet data collector configuration elements when not specified in runsettings|
281+
|CoverletCollectorDirectoryPath|Specify path to directory containing coverlet collector files if you need functionality that the FCC version does not provide.|
282+
|CoverletConsoleLocal|Specify true to use your own dotnet tools local install of coverlet console.|
283+
|CoverletConsoleCustomPath|Specify path to coverlet console exe if you need functionality that the FCC version does not provide.|
284+
|CoverletConsoleGlobal|Specify true to use your own dotnet tools global install of coverlet console.|
285+
|**The "CoverletConsole" settings have precedence Local / CustomPath / Global.**||
286+
|<br>||
287+
|**OpenCover**||
288+
|OpenCoverCustomPath|Specify path to open cover exe if you need functionality that the FCC version does not provide.|
289+
|ThresholdForNPathComplexity|When [npath complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) exceeds this value for a method then the method will be present in the risk hotspots tab.|
290+
|ThresholdForCrapScore|When [crap score](https://testing.googleblog.com/2011/02/this-code-is-crap.html) exceeds this value for a method then the method will be present in the risk hotspots tab.|
291+
236292

237-
ShowCoverageInOverviewMargin Set to false to prevent coverage marks in the overview margin
238-
ShowCoveredInOverviewMargin Set to false to prevent covered marks in the overview margin
239-
ShowUncoveredInOverviewMargin Set to false to prevent uncovered marks in the overview margin
240-
ShowPartiallyCoveredInOverviewMargin Set to false to prevent partially covered marks in the overview margin
293+
## Exclusions and inclusions
294+
You probably want to set IncludeReferencedProjects to true. This will ensure that you do not get coverage for testing frameworks - only your code.
241295

242-
ShowToolWindowToolbar Set to false to hide the toolbar on the tool window. Requires restarting Visual Studio. The toolbar has buttons for viewing
243-
the Cobertura xml and the risk hotspots.
296+
Coverlet and OpenCover use filter expressions.
297+
Filter expressions
244298

245-
FCCSolutionOutputDirectoryName To have fcc output visible in a sub folder of your solution provide this name
299+
Wildcards
246300

247-
ToolsDirectory Folder to which copy tools subfolder. Must alredy exist. Requires restart of VS.
301+
\* => matches zero or more characters
302+
303+
Examples
248304

249-
ThresholdForCyclomaticComplexity When [cyclomatic complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) exceeds this value for a method then the method will be present in the risk hotspots tab.
305+
[\*]* => All types in all assemblies.
250306

251-
StickyCoverageTable Set to true for coverage table to have a sticky thead.
252-
NamespacedClasses Set to false to show classes in report in short form. Affects grouping.
253-
HideFullyCovered Set to true to hide classes, namespaces and assemblies that are fully covered.
254-
Hide0Coverage Set to true to hide classes, namespaces and assemblies that have 0% coverage.
255-
Hide0Coverable Set to false to show classes, namespaces and assemblies that are not coverable.
307+
[coverlet\.\*]Coverlet.Core.Coverage => The Coverage class in the Coverlet.Core namespace belonging to any assembly that matches coverlet.* (e.g coverlet.core)
256308

257-
Enabled Specifies whether or not coverage output is enabled
258-
RunWhenTestsFail By default coverage runs when tests fail. Set to false to prevent this. **Cannot be used in conjunction with RunInParallel**
259-
RunWhenTestsExceed Specify a value to only run coverage based upon the number of executing tests. **Cannot be used in conjunction with RunInParallel**
260-
RunMsCodeCoverage Change to IfInRunSettings to only collect with configured runsettings. Yes for runsettings generation.
309+
[\*\]Coverlet.Core.Instrumentation.* => All types belonging to Coverlet.Core.Instrumentation namespace in any assembly
261310

262-
IncludeTestAssembly Specifies whether to report code coverage of the test assembly
263-
IncludeReferencedProjects Set to true to add all referenced projects to Include.
264-
IncludeAssemblies Provide a list of assemblies to include in coverage. The dll name without extension is used for matching.
265-
ExcludeAssemblies Provide a list of assemblies to exclude from coverage. The dll name without extension is used for matching.
311+
[coverlet\.\*.tests]* => All types in any assembly starting with coverlet. and ending with .tests
266312

267-
*** OpenCover / Coverlet
268-
AdjacentBuildOutput If your tests are dependent upon their path set this to true.
313+
Both 'Exclude' and 'Include' options can be used together but 'Exclude' takes precedence.
269314

270-
Exclude Filter expressions to exclude specific modules and types (multiple values)
271-
Include Filter expressions to include specific modules and types (multiple values)
272-
ExcludeByFile Glob patterns specifying source files to exclude e.g. **/Migrations/* (multiple values)
273-
ExcludeByAttribute Attributes to exclude from code coverage (multiple values)
274-
RunInParallel By default OpenCover / Coverlet tests run and then coverage is performed. Set to true to run coverage immediately
315+
Ms code coverage uses [regexes](https://learn.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis?view=vs-2022#regular-expressions).
316+
You can include or exclude assemblies or specific types and members from code coverage analysis. If the Include section is empty or omitted, then all assemblies that are loaded and have associated PDB files are included. If an assembly or member matches a clause in the Exclude section, then it is excluded from code coverage. The Exclude section takes precedence over the Include section: if an assembly is listed in both Include and Exclude, it will not be included in code coverage.
275317

276-
Filter expressions
277-
Wildcards
278-
* => matches zero or more characters
279-
280-
Examples
281-
[*]* => All types in all assemblies (nothing is instrumented)
282-
[coverlet.*]Coverlet.Core.Coverage => The Coverage class in the Coverlet.Core namespace belonging to any assembly that matches coverlet.* (e.g coverlet.core)
283-
[*]Coverlet.Core.Instrumentation.* => All types belonging to Coverlet.Core.Instrumentation namespace in any assembly
284-
[coverlet.*.tests]* => All types in any assembly starting with coverlet. and ending with .tests
285318

319+
You can ignore a method or an entire class from code coverage by applying the [ExcludeFromCodeCoverage] attribute present in the System.Diagnostics.CodeAnalysis namespace.
286320

287-
Both 'Exclude' and 'Include' options can be used together but 'Exclude' takes precedence.
321+
For .Net Framework this attribute cannot be applied at the assembly level. See FCCExcludeFromCodeCoverage above for similar functinality.
288322

289-
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.
290-
You can also ignore additional attributes by adding to the 'ExcludeByAttributes' list (short name or full name supported) e.g. :
291-
[GeneratedCode] => Present in System.CodeDom.Compiler namespace
292-
[MyCustomExcludeFromCodeCoverage] => Any custom attribute that you may define
323+
You can also ignore additional attributes by adding to the 'ExcludeByAttributes' list for Coverlet/OpenCover (short name or full name supported)
293324

294-
*** MS Code Coverage each multiple regexes to be transformed into runsettings elements
295-
ModulePathsExclude
296-
ModulePathsInclude
297-
CompanyNamesExclude
298-
CompanyNamesInclude
299-
PublicKeyTokensExclude
300-
PublicKeyTokensInclude
301-
SourcesExclude
302-
SourcesInclude
303-
AttributesExclude
304-
AttributesInclude
305-
FunctionsExclude
306-
FunctionsInclude
307-
308-
*** Coverlet
309-
RunSettingsOnly Specify false for global and project options to be used for coverlet data collector configuration elements when not specified in runsettings
310-
CoverletCollectorDirectoryPath Specify path to directory containing coverlet collector files if you need functionality that the FCC version does not provide.
311-
CoverletConsoleLocal Specify true to use your own dotnet tools local install of coverlet console.
312-
CoverletConsoleCustomPath Specify path to coverlet console exe if you need functionality that the FCC version does not provide.
313-
CoverletConsoleGlobal Specify true to use your own dotnet tools global install of coverlet console.
314-
315-
The "CoverletConsole" settings have precedence Local / CustomPath / Global.
316-
317-
*** OpenCover
318-
OpenCoverCustomPath Specify path to open cover exe if you need functionality that the FCC version does not provide.
319-
ThresholdForNPathComplexity When [npath complexity](https://en.wikipedia.org/wiki/Cyclomatic_complexity) exceeds this value for a method then the method will be present in the risk hotspots tab. OpenCover only.
320-
ThresholdForCrapScore When [crap score](https://testing.googleblog.com/2011/02/this-code-is-crap.html) exceeds this value for a method then the method will be present in the risk hotspots tab. OpenCover only.
325+
e.g. :
321326

327+
[GeneratedCode] => Present in System.CodeDom.Compiler namespace
322328

323-
324-
```
325-
## Exclusions and inclusions
326-
You probably want to set IncludeReferencedProjects to true. This will ensure that you do not get coverage for testing frameworks - only your code.
327-
Coverlet and OpenCover use [filter expressions](https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/MSBuildIntegration.md#filters).
328-
Ms code coverage uses [regexes](https://learn.microsoft.com/en-us/visualstudio/test/customizing-code-coverage-analysis?view=vs-2022#regular-expressions).
329+
[MyCustomExcludeFromCodeCoverage] => Any custom attribute that you may define
330+
331+
or for ms code coverage - AttributesExclude
329332

330333
## FCC Output
331334
FCC outputs, by default, inside each test project's Debug folder.

0 commit comments

Comments
 (0)