Skip to content

Commit 61151b0

Browse files
committed
update README.md
1 parent e0c670e commit 61151b0

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

README.md

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,25 @@ Arguments:
5656
<ASSEMBLY> Path to the test assembly.
5757

5858
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.
7778
```
7879
7980
#### Code Coverage
@@ -241,6 +242,8 @@ Examples
241242
242243
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.
243244
245+
You can also include coverage of the test assembly itself by specifying the `--include-test-assembly` flag.
246+
244247
### MSBuild
245248
246249
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
384387
- `/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`)
385388
- `/p:Include="[coverlet.*.tests?]*"` => Includes all types in any assembly starting with `coverlet.` and ending with `.test` or `.tests` (the `?` makes the `s` optional)
386389
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 (`,`).
388391
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`.
390393
391394
### SourceLink
392395

src/coverlet.console/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static int Main(string[] args)
3838
CommandOption excludedSourceFiles = app.Option("--exclude-by-file", "Glob patterns specifying source files to exclude.", CommandOptionType.MultipleValue);
3939
CommandOption includeDirectories = app.Option("--include-directory", "Include directories containing additional assemblies to be instrumented.", CommandOptionType.MultipleValue);
4040
CommandOption excludeAttributes = app.Option("--exclude-by-attribute", "Attributes to exclude from code coverage.", CommandOptionType.MultipleValue);
41-
CommandOption includeTestAssembly = app.Option("--include-test-assembly", "Specifies whether to report code coverage of the test assembly", CommandOptionType.NoValue);
41+
CommandOption includeTestAssembly = app.Option("--include-test-assembly", "Specifies whether to report code coverage of the test assembly.", CommandOptionType.NoValue);
4242
CommandOption singleHit = app.Option("--single-hit", "Specifies whether to limit code coverage hit reporting to a single hit for each location", CommandOptionType.NoValue);
4343
CommandOption mergeWith = app.Option("--merge-with", "Path to existing coverage result to merge.", CommandOptionType.SingleValue);
4444
CommandOption useSourceLink = app.Option("--use-source-link", "Specifies whether to use SourceLink URIs in place of file system paths.", CommandOptionType.NoValue);

0 commit comments

Comments
 (0)