You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-20Lines changed: 23 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,24 +56,25 @@ Arguments:
56
56
<ASSEMBLY> Path to the test assembly.
57
57
58
58
Options:
59
-
-h|--help Show help information
60
-
-v|--version Show version information
61
-
-t|--target Path to the test runner application.
62
-
-a|--targetargs Arguments to be passed to the test runner.
63
-
-o|--output Output of the generated coverage report
64
-
-v|--verbosity Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed.
65
-
-f|--format Format of the generated coverage report.
66
-
--threshold Exits with error if the coverage % is below value.
67
-
--threshold-type Coverage type to apply the threshold to.
68
-
--threshold-stat Coverage statistic used to enforce the threshold value.
69
-
--exclude Filter expressions to exclude specific modules and types.
70
-
--include Filter expressions to include specific modules and types.
71
-
--include-directory Include directories containing additional assemblies to be instrumented.
72
-
--exclude-by-file Glob patterns specifying source files to exclude.
73
-
--exclude-by-attribute Attributes to exclude from code coverage.
74
-
--merge-with Path to existing coverage result to merge.
75
-
--use-source-link Specifies whether to use SourceLink URIs in place of file system paths.
76
-
--single-hit Specifies whether to limit code coverage hit reporting to a single hit for each location.
59
+
-h|--help Show help information
60
+
-v|--version Show version information
61
+
-t|--target Path to the test runner application.
62
+
-a|--targetargs Arguments to be passed to the test runner.
63
+
-o|--output Output of the generated coverage report
64
+
-v|--verbosity Sets the verbosity level of the command. Allowed values are quiet, minimal, normal, detailed.
65
+
-f|--format Format of the generated coverage report.
66
+
--threshold Exits with error if the coverage % is below value.
67
+
--threshold-type Coverage type to apply the threshold to.
68
+
--threshold-stat Coverage statistic used to enforce the threshold value.
69
+
--exclude Filter expressions to exclude specific modules and types.
70
+
--include Filter expressions to include specific modules and types.
71
+
--include-directory Include directories containing additional assemblies to be instrumented.
72
+
--exclude-by-file Glob patterns specifying source files to exclude.
73
+
--exclude-by-attribute Attributes to exclude from code coverage.
74
+
--include-test-assembly Specifies whether to report code coverage of the test assembly.
75
+
--single-hit Specifies whether to limit code coverage hit reporting to a single hit for each location.
76
+
--merge-with Path to existing coverage result to merge.
77
+
--use-source-link Specifies whether to use SourceLink URIs in place of file system paths.
77
78
```
78
79
79
80
#### Code Coverage
@@ -241,6 +242,8 @@ Examples
241
242
242
243
Both `--exclude` and `--include` options can be used together but `--exclude` takes precedence. You can specify the `--exclude` and `--include` options multiple times to allow for multiple filter expressions.
243
244
245
+
You can also include coverage of the test assembly itself by specifying the `--include-test-assembly` flag.
246
+
244
247
### MSBuild
245
248
246
249
In this mode, Coverlet doesn't require any additional setup other than including the NuGet package in the unit test project. It integrates with the `dotnet test` infrastructure built into the .NET Core CLI and when enabled, will automatically generate coverage results after tests are run.
@@ -384,9 +387,9 @@ Examples
384
387
- `/p:Include="[coverlet.*]Coverlet.Core.Coverage"` => Includes the Coverage class in the `Coverlet.Core` namespace belonging to any assembly that matches `coverlet.*` (e.g `coverlet.core`)
385
388
- `/p:Include="[coverlet.*.tests?]*"` => Includes all types in any assembly starting with `coverlet.` and ending with `.test` or `.tests` (the `?` makes the `s` optional)
386
389
387
-
Both `Exclude` and `Include` properties can be used together but `Exclude` takes precedence.
390
+
Both `Exclude` and `Include` properties can be used together but `Exclude` takes precedence. You can specify multiple filter expressions by separting them with a comma (`,`).
388
391
389
-
You can specify multiple filter expressions by separting them with a comma (`,`).
392
+
You can also include coverage of the test assembly itself by setting `/p:IncludeTestAssembly` to `true`.
Copy file name to clipboardExpand all lines: src/coverlet.console/Program.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ static int Main(string[] args)
38
38
CommandOptionexcludedSourceFiles=app.Option("--exclude-by-file","Glob patterns specifying source files to exclude.",CommandOptionType.MultipleValue);
39
39
CommandOptionincludeDirectories=app.Option("--include-directory","Include directories containing additional assemblies to be instrumented.",CommandOptionType.MultipleValue);
40
40
CommandOptionexcludeAttributes=app.Option("--exclude-by-attribute","Attributes to exclude from code coverage.",CommandOptionType.MultipleValue);
41
-
CommandOptionincludeTestAssembly=app.Option("--include-test-assembly","Specifies whether to report code coverage of the test assembly",CommandOptionType.NoValue);
41
+
CommandOptionincludeTestAssembly=app.Option("--include-test-assembly","Specifies whether to report code coverage of the test assembly.",CommandOptionType.NoValue);
42
42
CommandOptionsingleHit=app.Option("--single-hit","Specifies whether to limit code coverage hit reporting to a single hit for each location",CommandOptionType.NoValue);
43
43
CommandOptionmergeWith=app.Option("--merge-with","Path to existing coverage result to merge.",CommandOptionType.SingleValue);
44
44
CommandOptionuseSourceLink=app.Option("--use-source-link","Specifies whether to use SourceLink URIs in place of file system paths.",CommandOptionType.NoValue);
0 commit comments