Skip to content

Commit 304a41a

Browse files
committed
update docs
1 parent 28fb5af commit 304a41a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,15 @@ Options:
6464
-f|--format Format of the generated coverage report.
6565
--threshold Exits with error if the coverage % is below value.
6666
--threshold-type Coverage type to apply the threshold to.
67+
--threshold-stat Coverage statistic used to enforce the threshold value.
6768
--exclude Filter expressions to exclude specific modules and types.
6869
--include Filter expressions to include specific modules and types.
6970
--include-directory Include directories containing additional assemblies to be instrumented.
7071
--exclude-by-file Glob patterns specifying source files to exclude.
7172
--include-directory Include directories containing additional assemblies to be instrumented.
7273
--exclude-by-attribute Attributes to exclude from code coverage.
7374
--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.
7476
```
7577
7678
#### Code Coverage
@@ -173,6 +175,18 @@ You can specify the `--threshold-type` option multiple times. Valid values inclu
173175
coverlet <ASSEMBLY> --target <TARGET> --targetargs <TARGETARGS> --threshold 80 --threshold-type line --threshold-type method
174176
```
175177
178+
By default, Coverlet will validate the threshold value against the coverage result of each module. The `--threshold-stat` option allows you to change this behaviour and can have any of the following values:
179+
180+
* Minimum (Default): Ensures the coverage result of each module isn't less than the threshold
181+
* Total: Ensures the total combined coverage result of all modules isn't less than the threshold
182+
* Average: Ensures the average coverage result of all modules isn't less than the threshold
183+
184+
The following command will compare the threshold value with the overall total coverage of all modules:
185+
186+
```bash
187+
coverlet <ASSEMBLY> --target <TARGET> --targetargs <TARGETARGS> --threshold 80 --threshold-type line --threshold-stat total
188+
```
189+
176190
#### Excluding From Coverage
177191
178192
##### Attributes
@@ -308,6 +322,18 @@ dotnet test /p:CollectCoverage=true /p:Threshold=80 /p:ThresholdType=line
308322
309323
You can specify multiple values for `ThresholdType` by separating them with commas. Valid values include `line`, `branch` and `method`.
310324
325+
By default, Coverlet will validate the threshold value against the coverage result of each module. The `/p:ThresholdStat` option allows you to change this behaviour and can have any of the following values:
326+
327+
* Minimum (Default): Ensures the coverage result of each module isn't less than the threshold
328+
* Total: Ensures the total combined coverage result of all modules isn't less than the threshold
329+
* Average: Ensures the average coverage result of all modules isn't less than the threshold
330+
331+
The following command will compare the threshold value with the overall total coverage of all modules:
332+
333+
```bash
334+
dotnet test /p:CollectCoverage=true /p:Threshold=80 /p:ThresholdType=line /p:ThresholdStat=total
335+
```
336+
311337
#### Excluding From Coverage
312338
313339
##### Attributes
@@ -361,6 +387,10 @@ Both `Exclude` and `Include` properties can be used together but `Exclude` takes
361387
362388
You can specify multiple filter expressions by separting them with a comma (`,`).
363389
390+
### SourceLink
391+
392+
Coverlet supports [SourceLink](https://github.com/dotnet/sourcelink) custom debug information contained in PDBs. When you specify the `--use-source-link` flag in the global tool or `/p:UseSourceLink=true` property in the MSBuild command, Coverlet will generate results that contain the URL to the source files in your source control instead of absolute file paths.
393+
364394
### Cake Addin
365395
If you're using [Cake Build](https://cakebuild.net) for your build script you can use the [Cake.Coverlet](https://github.com/Romanx/Cake.Coverlet) addin to provide you extensions to dotnet test for passing coverlet arguments in a strongly typed manner.
366396

0 commit comments

Comments
 (0)