-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Split dotnet test docs #50256
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
base: main
Are you sure you want to change the base?
Split dotnet test docs #50256
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,208 @@ | ||||||||||
| --- | ||||||||||
| title: dotnet test command with Microsoft.Testing.Platform | ||||||||||
| description: The dotnet test command is used to execute unit tests in a given project using Microsoft.Testing.Platform (MTP). | ||||||||||
| ms.date: 12/29/2024 | ||||||||||
| ai-usage: ai-assisted | ||||||||||
| --- | ||||||||||
| # dotnet test with Microsoft.Testing.Platform (MTP) | ||||||||||
|
|
||||||||||
| **This article applies to:** ✔️ .NET 10 SDK and later versions | ||||||||||
|
|
||||||||||
| ## Name | ||||||||||
|
|
||||||||||
| `dotnet test` - .NET test driver used to execute unit tests with Microsoft.Testing.Platform. | ||||||||||
|
|
||||||||||
| ## Synopsis | ||||||||||
|
|
||||||||||
| ```dotnetcli | ||||||||||
| dotnet test | ||||||||||
| [--project <PROJECT_PATH>] | ||||||||||
| [--solution <SOLUTION_PATH>] | ||||||||||
| [--test-modules <EXPRESSION>] | ||||||||||
| [--root-directory <ROOT_PATH>] | ||||||||||
| [--max-parallel-test-modules <NUMBER>] | ||||||||||
| [-a|--arch <ARCHITECTURE>] | ||||||||||
| [-c|--configuration <CONFIGURATION>] | ||||||||||
| [-f|--framework <FRAMEWORK>] | ||||||||||
| [--os <OS>] | ||||||||||
| [-r|--runtime <RUNTIME_IDENTIFIER>] | ||||||||||
| [-v|--verbosity <LEVEL>] | ||||||||||
| [--no-build] | ||||||||||
| [--no-restore] | ||||||||||
| [--no-ansi] | ||||||||||
| [--no-progress] | ||||||||||
| [--output <VERBOSITY_LEVEL>] | ||||||||||
| [--no-launch-profile] | ||||||||||
| [--no-launch-profile-arguments] | ||||||||||
| [<args>...] | ||||||||||
|
|
||||||||||
| dotnet test -h|--help | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ## Description | ||||||||||
|
|
||||||||||
| 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). | ||||||||||
|
|
||||||||||
| > [!WARNING] | ||||||||||
| > When Microsoft.Testing.Platform is opted in via `global.json`, `dotnet test` expects all test projects to use Microsoft.Testing.Platform. It is an error if any of the test projects use VSTest. | ||||||||||
|
|
||||||||||
| ## Implicit restore | ||||||||||
|
|
||||||||||
| [!INCLUDE[dotnet restore note](~/includes/dotnet-restore-note.md)] | ||||||||||
|
|
||||||||||
| ## Options | ||||||||||
|
|
||||||||||
| > [!NOTE] | ||||||||||
| > You can use only one of the following options at a time: `--project`, `--solution`, or `--test-modules`. These options can't be combined. | ||||||||||
| > 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. | ||||||||||
|
|
||||||||||
| - **`--project <PROJECT_PATH>`** | ||||||||||
|
|
||||||||||
| Specifies the path of the project file to run (folder name or full path). If not specified, it defaults to the current directory. | ||||||||||
|
|
||||||||||
| - **`--solution <SOLUTION_PATH>`** | ||||||||||
|
|
||||||||||
| Specifies the path of the solution file to run (folder name or full path). If not specified, it defaults to the current directory. | ||||||||||
|
|
||||||||||
| - **`--test-modules <EXPRESSION>`** | ||||||||||
|
|
||||||||||
| 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). | ||||||||||
|
||||||||||
| 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). | |
| 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](../extensions/file-globbing.md). |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing contraction: According to the Markdown writing style guidelines, use contractions for a conversational tone. Change "is not" to "isn't".
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing contraction: According to the Markdown writing style guidelines, use contractions for a conversational tone. Change "Do not" to "Don't" at the start of the sentence.
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing contraction: According to the Markdown writing style guidelines, use contractions for a conversational tone. Change "Do not" to "Don't" at the start of the sentence.
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: "informatiom" should be "information"
| More informatiom about the available arguments can be found in [the dotnet msbuild documentation](dotnet-msbuild.md). | |
| More information about the available arguments can be found in [the dotnet msbuild documentation](dotnet-msbuild.md). |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect relative link paths: The links should use relative paths from the current file location without the redundant path prefix. Change from "../../../docs/core/testing/microsoft-testing-platform-intro.md" to "../testing/microsoft-testing-platform-intro.md" and from "../../../docs/core/testing/microsoft-testing-platform-extensions.md" to "../testing/microsoft-testing-platform-extensions.md".
| 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). | |
| 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](../testing/microsoft-testing-platform-intro.md) and [Microsoft.Testing.Platform extensions](../testing/microsoft-testing-platform-extensions.md). |
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect relative link paths: The links should use relative paths from the current file location without the redundant path prefix. Change from "../../../docs/core/testing/microsoft-testing-platform-intro.md" to "../testing/microsoft-testing-platform-intro.md" and from "../../../docs/core/testing/microsoft-testing-platform-extensions.md" to "../testing/microsoft-testing-platform-extensions.md".
| - [Microsoft.Testing.Platform](../../../docs/core/testing/microsoft-testing-platform-intro.md) | |
| - [Microsoft.Testing.Platform extensions](../../../docs/core/testing/microsoft-testing-platform-extensions.md) | |
| - [Microsoft.Testing.Platform](../testing/microsoft-testing-platform-intro.md) | |
| - [Microsoft.Testing.Platform extensions](../testing/microsoft-testing-platform-extensions.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing contraction: According to the Markdown writing style guidelines, use contractions for a conversational tone. Change "are not" to "aren't".