Skip to content

Commit 766eb70

Browse files
Update dotnet-test docs (#45357)
* Update dotnet-test docs * Apply suggestions from code review Co-authored-by: Genevieve Warren <[email protected]> --------- Co-authored-by: Genevieve Warren <[email protected]>
1 parent ee098e9 commit 766eb70

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

docs/core/tools/dotnet-test.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Some examples of the `dotnet.config` file:
2525
name = "VSTest"
2626
```
2727

28-
## VSTest and Microsoft Testing Platform (MTP)
28+
## VSTest and Microsoft.Testing.Platform (MTP)
2929

3030
### [dotnet test with VSTest](#tab/dotnet-test-with-vstest)
3131

@@ -441,14 +441,18 @@ dotnet test -h|--help
441441
With Microsoft Testing Platform, `dotnet test` operates faster than with VSTest. The test-related arguments are no longer fixed, as they are tied to the registered extensions in the test project(s). Moreover, MTP supports a globbing filter when running tests. For more information, see [Microsoft.Testing.Platform](../testing/microsoft-testing-platform-intro.md).
442442

443443
> [!WARNING]
444-
> `dotnet test` doesn't run in environments that have test projects using both VSTest and Microsoft Testing Platform in the same solution, as the two platforms are mutually incompatible.
444+
> When Microsoft.Testing.Platform is opted in via `dotnet.config`, `dotnet test` expects all test projects to use Microsoft.Testing.Platform. It is an error if any of the test projects use VSTest.
445445
446446
#### Implicit restore
447447

448448
[!INCLUDE[dotnet restore note](~/includes/dotnet-restore-note.md)]
449449

450450
#### Options
451451

452+
> [!NOTE]
453+
> You can use only one of the following options at a time: `--project`, `--solution`, `--directory`, or `--test-modules`. These options can't be combined.
454+
> In addition, when using `--test-modules`, you can't specify `--arch`, `--configuration`, `--framework`, `--os`, or `--runtime`. These options are not relevant for an already-built module.
455+
452456
- **`--project <PROJECT_PATH>`**
453457

454458
Specifies the path to the test project.
@@ -461,9 +465,6 @@ With Microsoft Testing Platform, `dotnet test` operates faster than with VSTest.
461465

462466
Specifies the path to a directory that contains a project or a solution.
463467

464-
> [!NOTE]
465-
> You can use only one of the following options at a time: `--project`, `--solution`, or `--directory`. These options can't be combined.
466-
467468
- **`--test-modules <EXPRESSION>`**
468469

469470
Filters test modules using file globbing in .NET. Only tests belonging to those test modules will run. For more information and examples on how to use file globbing in .NET, see [File globbing](../../../docs/core/extensions/file-globbing.md).
@@ -533,14 +534,17 @@ With Microsoft Testing Platform, `dotnet test` operates faster than with VSTest.
533534

534535
- **`args`**
535536

536-
Specifies extra arguments to pass to the test application(s). Use a space to separate multiple arguments. For more information and examples on what to pass, see [Microsoft Testing Platform](../../../docs/core/testing/microsoft-testing-platform-intro.md) and [Microsoft.Testing.Platform extensions](../../../docs/core/testing/microsoft-testing-platform-extensions.md).
537+
Specifies extra arguments to pass to the test application(s). Use a space to separate multiple arguments. For more information and examples on what to pass, see [Microsoft.Testing.Platform overview](../../../docs/core/testing/microsoft-testing-platform-intro.md) and [Microsoft.Testing.Platform extensions](../../../docs/core/testing/microsoft-testing-platform-extensions.md).
538+
539+
> [!TIP]
540+
> To specify extra arguments for specific projects, use the `TestingPlatformCommandLineArguments` MSBuild property.
537541
538542
> [!NOTE]
539543
> To enable trace logging to a file, use the environment variable `DOTNET_CLI_TEST_TRACEFILE` to provide the path to the trace file.
540544
541545
#### Examples
542546

543-
- Run the tests in the project in the current directory:
547+
- Run the tests in the project or solution in the current directory:
544548

545549
```dotnetcli
546550
dotnet test
@@ -558,7 +562,7 @@ With Microsoft Testing Platform, `dotnet test` operates faster than with VSTest.
558562
dotnet test --solution ./TestProjects/TestProjects.sln
559563
```
560564

561-
- Run the tests in the `TestProjects` directory:
565+
- Run the tests in a solution or project that can be found in the `TestProjects` directory:
562566

563567
```dotnetcli
564568
dotnet test --directory ./TestProjects

0 commit comments

Comments
 (0)