Skip to content

Commit fece36a

Browse files
committed
add documentation for merging results
1 parent 6738b33 commit fece36a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Options:
6767
--exclude Filter expressions to exclude specific modules and types.
6868
--include Filter expressions to include specific modules and types.
6969
--exclude-by-file Glob patterns specifying source files to exclude.
70+
--merge-with Path to existing coverage result to merge.
7071
```
7172
7273
#### Code Coverage
@@ -116,6 +117,16 @@ The above command will write the results to the supplied path, if no file extens
116117
coverlet <ASSEMBLY> --target <TARGET> --targetargs <TARGETARGS> --output "/custom/directory/" -f json -f lcov
117118
```
118119
120+
#### Merging Results
121+
122+
With Coverlet you can combine the output of multiple coverage runs into a single result.
123+
124+
```bash
125+
coverlet <ASSEMBLY> --target <TARGET> --targetargs <TARGETARGS> --merge-with "/path/to/result.json" --format opencover
126+
```
127+
128+
The value given to `--merge-with` **must** be a path to Coverlet's own json result format.
129+
119130
#### Threshold
120131
121132
Coverlet allows you to specify a coverage threshold below which it returns a non-zero exit code. This allows you to enforce a minimum coverage percent on all changes to your project.
@@ -228,6 +239,16 @@ To specify a directory where all results will be written to (especially if using
228239
dotnet test /p:CollectCoverage=true /p:CoverletOutput='./results/'
229240
```
230241
242+
#### Merging Results
243+
244+
With Coverlet you can combine the output of multiple coverage runs into a single result.
245+
246+
```bash
247+
dotnet test /p:CollectCoverage=true /p:MergeWith='/path/to/result.json'
248+
```
249+
250+
The value given to `/p:MergeWith` **must** be a path to Coverlet's own json result format.
251+
231252
#### Threshold
232253
233254
Coverlet allows you to specify a coverage threshold below which it fails the build. This allows you to enforce a minimum coverage percent on all changes to your project.

0 commit comments

Comments
 (0)