Skip to content

Commit 256e294

Browse files
authored
Update code coverage documentation with example (#5)
This pull request updates the documentation to clarify how to use the --coverage-settings option when running tests with code coverage. It adds a helpful note explaining that the path to the .runsettings file can be relative or absolute, and provides an example command for both dotnet run and dotnet test.
1 parent 53fbc40 commit 256e294

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

site/docs/getting-started/v3/code-coverage-with-mtp.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ $ dotnet run --project Tests -- -?
182182

183183
Passing `--coverage` is the minimum requirement for enabling code coverage; the other three switches influence how the coverage information is reported.
184184

185+
> [!NOTE]
186+
> The `--coverage-settings` is a path to the `.runsettings` file relative from your test project. Alternatively, you could use a full path to the `.runsettings` file. You could in example use it like: `dotnet run/test src/Foo.sln -- --coverage --coverage-output-format cobertura --coverage-output coverage.cobertura.xml --coverage-settings ${{ github.workspace }}/src/.runsettings'`. You can use `dotnet run` or `dotnet test`.
187+
185188
## Generating code coverage XML
186189

187190
### Using `dotnet run`

0 commit comments

Comments
 (0)