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/testing/unit-testing-platform-config.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,8 @@ The platform will automatically detect and load the *[appname].testconfig.json*
29
29
30
30
When using [Microsoft.Testing.Platform.MSBuild](https://www.nuget.org/packages/Microsoft.Testing.Platform.MSBuild), you can simply create a *testconfig.json* file that will be automatically renamed to *[appname].testconfig.json* and moved to the output directory of the test project.
31
31
32
+
Starting with Microsoft.Testing.Platform 1.5, you can use the command-line argument `--config-file` to specify the path to the *testconfig.json*. This file takes precedence over the *[appname].testconfig.json* file.
33
+
32
34
> [!NOTE]
33
35
> The *[appname].testconfig.json* file will get overwritten on subsequent builds.
34
36
@@ -38,3 +40,7 @@ Environment variables can be used to supply some runtime configuration informati
38
40
39
41
> [!NOTE]
40
42
> Environment variables take precedence over configuration settings in the *testconfig.json* file.
Starting with Microsoft.Testing.Platform 1.5, this environment variable sets the language of the platform for displaying messages and logs using a locale value such as `en-us`. This language takes precedence over the Visual Studio and .NET SDK languages. The supported values are the same as for Visual Studio. For more information, see the section on changing the installer language in the [Visual Studio installation documentation](/visualstudio/install/install-visual-studio).
If you are using MSTest.Sdk 3.7 or later, use the `EnableMicrosoftTestingExtensionsFakes` property to enable the extension and don't add the package reference.
Copy file name to clipboardExpand all lines: docs/core/testing/unit-testing-platform-intro.md
+55-16Lines changed: 55 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,56 +183,95 @@ To run a test project in CI add one step for each test executable that you wish
183
183
184
184
The list below described only the platform options. To see the specific options brought by each extension, either refer to the extension documentation page or use the `--help` option.
185
185
186
+
- **`@`**
187
+
188
+
Specifies the name of the response file. The response file name must immediately follow the @ character with no white space between the @ character and the response file name.
189
+
190
+
Options in a response file are interpreted as if they were present at that place in the command line. Each argument in a response file must begin and end on the same line. You cannot use the backslash character (\) to concatenate lines. Using a response file helps for very long commands that might exceed the terminal limits. You can combine a response file with inline command-line arguments. For example:
191
+
192
+
```console
193
+
./TestExecutable.exe @"filter.rsp" --timeout 10s
194
+
```
195
+
196
+
where *filter.rsp* can have the following contents:
197
+
198
+
```rsp
199
+
--filter "A very long filter"
200
+
```
201
+
202
+
Or a single rsp file can be used to specify both timeout and filter as follows:
203
+
204
+
```console
205
+
./TestExecutable.exe @"arguments.rsp"
206
+
```
207
+
208
+
```rsp
209
+
--filter "A very long filter"
210
+
--timeout 10s
211
+
```
212
+
213
+
- **`--config-file`**
214
+
215
+
Specifies a [*testconfig.json*](unit-testing-platform-config.md) file.
216
+
186
217
- **`--diagnostic`**
187
218
188
-
Enables the diagnostic logging. The default log level is `Trace`. The file is written in the output directory with the following name format, `log_[MMddHHssfff].diag`.
219
+
Enables the diagnostic logging. The default log level is `Trace`. The file is written in the output directory with the following name format, `log_[MMddHHssfff].diag`.
189
220
190
221
- **`--diagnostic-filelogger-synchronouswrite`**
191
222
192
-
Forces the built-in file logger to synchronously write logs. Useful for scenarios where you don't want to lose any log entries (if the process crashes). This does slow down the test execution.
223
+
Forces the built-in file logger to synchronously write logs. Useful for scenarios where you don't want to lose any log entries (if the process crashes). This does slow down the test execution.
193
224
194
225
- **`--diagnostic-output-directory`**
195
226
196
-
The output directory of the diagnostic logging, if not specified the file is generated in the default _TestResults_ directory.
227
+
The output directory of the diagnostic logging, if not specified the file is generated in the default _TestResults_ directory.
197
228
198
229
- **`--diagnostic-output-fileprefix`**
199
230
200
-
The prefix for the log file name. Defaults to `"log_"`.
231
+
The prefix for the log file name. Defaults to `"log_"`.
201
232
202
233
- **`--diagnostic-verbosity`**
203
234
204
-
Defines the verbosity level when the `--diagnostic` switch is used. The available values are `Trace`, `Debug`, `Information`, `Warning`, `Error`, or `Critical`.
235
+
Defines the verbosity level when the `--diagnostic` switch is used. The available values are `Trace`, `Debug`, `Information`, `Warning`, `Error`, or `Critical`.
236
+
237
+
- **`--exit-on-process-exit`**
238
+
239
+
Exit the test process if dependent process exits. PID must be provided.
205
240
206
241
- **`--help`**
207
242
208
-
Prints out a description of how to use the command.
243
+
Prints out a description of how to use the command.
209
244
210
245
- **`-ignore-exit-code`**
211
246
212
-
Allows some non-zero exit codes to be ignored, and instead returned as `0`. For more information, see [Ignore specific exit codes](./unit-testing-platform-exit-codes.md#ignore-specific-exit-codes).
247
+
Allows some non-zero exit codes to be ignored, and instead returned as `0`. For more information, see [Ignore specific exit codes](./unit-testing-platform-exit-codes.md#ignore-specific-exit-codes).
213
248
214
249
- **`--info`**
215
250
216
-
Displays advanced information about the .NET Test Application such as:
251
+
Displays advanced information about the .NET Test Application such as:
217
252
218
-
- The platform.
219
-
- The environment.
220
-
- Each registered command line provider, such as its, `name`, `version`, `description` and `options`.
221
-
- Each registered tool, such as its, `command`, `name`, `version`, `description`, and all commandline providers.
253
+
- The platform.
254
+
- The environment.
255
+
- Each registered command line provider, such as its `name`, `version`, `description`, and `options`.
256
+
- Each registered tool, such as its `command`, `name`, `version`, `description`, and all command-line providers.
222
257
223
-
This feature is used to understand extensions that would be registering the same command line option or the changes in available options between multiple versions of an extension (or the platform).
258
+
This feature is used to understand extensions that would be registering the same command line option or the changes in available options between multiple versions of an extension (or the platform).
224
259
225
260
- **`--list-tests`**
226
261
227
-
List available tests. Tests will not be executed.
262
+
List available tests. Tests will not be executed.
228
263
229
264
- **`--minimum-expected-tests`**
230
265
231
-
Specifies the minimum number of tests that are expected to run. By default, at least one test is expected to run.
266
+
Specifies the minimum number of tests that are expected to run. By default, at least one test is expected to run.
232
267
233
268
- **`--results-directory`**
234
269
235
-
The directory where the test results are going to be placed. If the specified directory doesn't exist, it's created. The default is `TestResults` in the directory that contains the test application.
270
+
The directory where the test results are going to be placed. If the specified directory doesn't exist, it's created. The default is `TestResults` in the directory that contains the test application.
271
+
272
+
- **`--timeout`**
273
+
274
+
A global test execution timeout. Takes one argument as string in the format `<value>[h|m|s]` where `<value>` is float.
0 commit comments