Skip to content

Commit b5468ce

Browse files
authored
Improve MTP coverage doc (#44522)
1 parent 9c520de commit b5468ce

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

docs/core/testing/unit-testing-platform-extensions-code-coverage.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,21 @@ Microsoft Code Coverage provides the following options:
3030
| Option | Description |
3131
|----------------------------|-------------------------------------------------------------------------------|
3232
| `--coverage` | Collect the code coverage using dotnet-coverage tool. |
33-
| `--coverage-output` | Output file. |
34-
| `--coverage-output-format` | Output file format. Supported values are: 'coverage', 'xml', and 'cobertura'. |
35-
| `--coverage-settings` | XML code coverage settings. |
33+
| `--coverage-output` | The name or path of the produced coverage file. By default, the file is `TestResults/<guid>.coverage`. |
34+
| `--coverage-output-format` | Output file format. Supported values are: `coverage`, `xml`, and `cobertura`. Default is `coverage`. |
35+
| `--coverage-settings` | [XML code coverage settings](../additional-tools/dotnet-coverage.md#settings). |
3636

3737
For more information about the available options, see [settings](../additional-tools/dotnet-coverage.md#settings) and [samples](https://github.com/microsoft/codecoverage/tree/main/samples/Algorithms).
3838

3939
## Coverlet
4040

41+
> [!IMPORTANT]
42+
> The `coverlet.collector` NuGet package is designed specifically for VSTest and cannot be used with `Microsoft.Testing.Platform`.
43+
4144
There's currently no Coverlet extension, but you can use [Coverlet .NET global tool](https://github.com/coverlet-coverage/coverlet#net-global-tool-guide-suffers-from-possible-known-issue).
45+
46+
Assuming you've already installed the Coverlet global tool, you can now run:
47+
48+
```bash
49+
coverlet .\bin\Debug\net8.0\TestProject2.dll --target "dotnet" --targetargs "test .\bin\Debug\net8.0\TestProject2.dll --no-build"
50+
```

0 commit comments

Comments
 (0)