Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet test CLI ref updates #18209

Merged
merged 5 commits into from
May 26, 2020
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/core/tools/dotnet-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ Test projects specify the test runner using an ordinary `<PackageReference>` ele
- **`--collect <DATA_COLLECTOR_FRIENDLY_NAME>`**

Enables data collector for the test run. For more information, see [Monitor and analyze test run](https://aka.ms/vstest-collect).

To collect code coverage on any platform that is supported by .NET Core, install [Coverlet](https://github.com/tonerdo/coverlet/blob/master/README.md) and use the `--collect:"XPlat Code Coverage"` option.
tdykstra marked this conversation as resolved.
Show resolved Hide resolved

On Windows, you can collect code coverage by using the `--collect "Code Coverage"` option. This option generates a *.coverage* file, which can be opened in Visual Studio 2019 Enterprise. For more information, see [Use code coverage](/visualstudio/test/using-code-coverage-to-determine-how-much-code-is-being-tested) and [Customize code coverage analysis](/visualstudio/test/customizing-code-coverage-analysis).

- **`-d|--diag <PATH_TO_DIAGNOSTICS_FILE>`**

Expand Down Expand Up @@ -156,6 +160,18 @@ Test projects specify the test runner using an ordinary `<PackageReference>` ele
dotnet test --logger trx
```

- Run the tests in the project in the current directory, and generate a code coverage file (after installing [Coverlet](https://github.com/tonerdo/coverlet/blob/master/README.md)):

```dotnetcli
dotnet test --collect:"XPlat Code Coverage"
```

- Run the tests in the project in the current directory, and generate a code coverage file (Windows only):

```dotnetcli
dotnet test --collect "Code Coverage"
```

- Run the tests in the project in the current directory, and log with detailed verbosity to the console:

```dotnetcli
Expand All @@ -174,6 +190,7 @@ Test projects specify the test runner using an ordinary `<PackageReference>` ele
| -------------- | --------------------------------------------------------------------------------------------------------- |
| MSTest | <ul><li>FullyQualifiedName</li><li>Name</li><li>ClassName</li><li>Priority</li><li>TestCategory</li></ul> |
| xUnit | <ul><li>FullyQualifiedName</li><li>DisplayName</li><li>Traits</li></ul> |
| NUnit | <ul><li>FullyQualifiedName</li><li>Name</li><li>TestCategory</li><li>Priority</li></ul> |

The `<operator>` describes the relationship between the property and the value:

Expand Down