You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/core/tools/dotnet-test.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Some examples of the `dotnet.config` file:
25
25
name = "VSTest"
26
26
```
27
27
28
-
## VSTest and MicrosoftTestingPlatform (MTP)
28
+
## VSTest and Microsoft.Testing.Platform (MTP)
29
29
30
30
### [dotnet test with VSTest](#tab/dotnet-test-with-vstest)
31
31
@@ -441,14 +441,18 @@ dotnet test -h|--help
441
441
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).
442
442
443
443
> [!WARNING]
444
-
> `dotnet test` doesn't run in environments that have test projects using both VSTest and Microsoft TestingPlatform 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.
> 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
+
452
456
-**`--project <PROJECT_PATH>`**
453
457
454
458
Specifies the path to the test project.
@@ -461,9 +465,6 @@ With Microsoft Testing Platform, `dotnet test` operates faster than with VSTest.
461
465
462
466
Specifies the path to a directory that contains a project or a solution.
463
467
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
-
467
468
-**`--test-modules <EXPRESSION>`**
468
469
469
470
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.
533
534
534
535
-**`args`**
535
536
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.
537
541
538
542
> [!NOTE]
539
543
> To enable trace logging to a file, use the environment variable `DOTNET_CLI_TEST_TRACEFILE` to provide the path to the trace file.
540
544
541
545
#### Examples
542
546
543
-
- Run the tests in the project in the current directory:
547
+
- Run the tests in the project or solution in the current directory:
544
548
545
549
```dotnetcli
546
550
dotnet test
@@ -558,7 +562,7 @@ With Microsoft Testing Platform, `dotnet test` operates faster than with VSTest.
558
562
dotnet test --solution ./TestProjects/TestProjects.sln
559
563
```
560
564
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:
0 commit comments