1dotnet vstest command - .NET Core CL.IN(E1Td)oCtonreet vstest command - .NET Core CLI(1)
2
3
4
7 dotnet-vstest - Runs tests from the specified files.
8
10 .NET Core 2.1
11 dotnet vstest [<TEST_FILE_NAMES>] [--Settings|/Settings] [--Tests|/Tests] [--TestAdapterPath|/TestAdapterPath]
12 [--Platform|/Platform] [--Framework|/Framework] [--Parallel|/Parallel] [--TestCaseFilter|/TestCaseFilter] [--logger|/logger]
13 [-lt|--ListTests|/lt|/ListTests] [--ParentProcessId|/ParentProcessId] [--Port|/Port] [--Diag|/Diag] [--Blame|/Blame] [--InIsolation|/InIsolation]
14 [[--] <args>...]] [-?|--Help|/?|/Help]
15
16 .NET Core 2.0
17 dotnet vstest [<TEST_FILE_NAMES>] [--Settings|/Settings] [--Tests|/Tests] [--TestAdapterPath|/TestAdapterPath]
18 [--Platform|/Platform] [--Framework|/Framework] [--Parallel|/Parallel] [--TestCaseFilter|/TestCaseFilter] [--logger|/logger]
19 [-lt|--ListTests|/lt|/ListTests] [--ParentProcessId|/ParentProcessId] [--Port|/Port] [--Diag|/Diag] [[--] <args>...]] [-?|--Help|/?|/Help]
20
21 .NET Core 1.x
22 dotnet vstest [<TEST_FILE_NAMES>] [--Settings|/Settings] [--Tests|/Tests] [--TestAdapterPath|/TestAdapterPath]
23 [--Platform|/Platform] [--Framework|/Framework] [--Parallel|/Parallel] [--TestCaseFilter|/TestCaseFilter] [--logger|/logger]
24 [-lt|--ListTests|/lt|/ListTests] [--ParentProcessId|/ParentProcessId] [--Port|/Port] [--Diag|/Diag] [[--] <args>...]] [-?|--Help|/?|/Help]
25
26 * * * * *
27
29 The dotnet-vstest command runs the VSTest.Console command-line applica‐
30 tion to run automated unit and coded UI application tests.
31
32 Arguments
33 TEST_FILE_NAMES
34
35 Run tests from the specified assemblies. Separate multiple test assem‐
36 bly names with spaces.
37
39 .NET Core 2.1
40 --Settings|/Settings:<Settings File>
41
42 Settings to use when running tests.
43
44 --Tests|/Tests:<Test Names>
45
46 Run tests with names that match the provided values. Separate multiple
47 values with commas.
48
49 --TestAdapterPath|/TestAdapterPath
50
51 Use custom test adapters from a given path (if any) in the test run.
52
53 --Platform|/Platform:<Platform type>
54
55 Target platform architecture used for test execution. Valid values are
56 x86, x64, and ARM.
57
58 --Framework|/Framework:<Framework Version>
59
60 Target .NET Framework version used for test execution. Examples of
61 valid values are .NETFramework,Version=v4.6 or .NETCoreApp,Ver‐
62 sion=v1.0. Other supported values are Framework35, Framework40, Frame‐
63 work45, FrameworkCore10, and FrameworkUap10.
64
65 --Parallel|/Parallel
66
67 Execute tests in parallel. By default, all available cores on the ma‐
68 chine are available for use. Set an explicit number of cores with a
69 settings file.
70
71 --TestCaseFilter|/TestCaseFilter:<Expression>
72
73 Run tests that match the given expression. <Expression> is of the for‐
74 mat <property>Operator<value>[|&<Expression>], where Operator is one of
75 =, !=, or ~. Operator ~ has `contains' semantics and is applicable for
76 string properties like DisplayName. Parenthesis () are used to group
77 sub-expressions.
78
79 -?|--Help|/?|/Help
80
81 Prints out a short help for the command.
82
83 --logger|/logger:<Logger Uri/FriendlyName>
84
85 Specify a logger for test results.
86
87 · To publish test results to Team Foundation Server, use the TfsPub‐
88 lisher logger provider:
89
90 /logger:TfsPublisher;
91 Collection=<team project collection url>;
92 BuildName=<build name>;
93 TeamProject=<team project name>
94 [;Platform=<Defaults to "Any CPU">]
95 [;Flavor=<Defaults to "Debug">]
96 [;RunTitle=<title>]
97
98 · To log results to a Visual Studio Test Results File (TRX), use the
99 trx logger provider. This switch creates a file in the test results
100 directory with given log file name. If LogFileName isn't provided, a
101 unique file name is created to hold the test results.
102
103 /logger:trx [;LogFileName=<Defaults to unique file name>]
104
105 -lt|--ListTests|/lt|/ListTests:<File Name>
106
107 Lists all discovered tests from the given test container.
108
109 --ParentProcessId|/ParentProcessId:<ParentProcessId>
110
111 Process ID of the parent process responsible for launching the current
112 process.
113
114 --Port|/Port:<Port>
115
116 Specifies the port for the socket connection and receiving the event
117 messages.
118
119 --Diag|/Diag:<Path to log file>
120
121 Enables verbose logs for the test platform. Logs are written to the
122 provided file.
123
124 --Blame|/Blame
125
126 Runs the tests in blame mode. This option is helpful in isolating the
127 problematic tests causing test host to crash. It creates an output
128 file in the current directory as Sequence.xml that captures the order
129 of tests execution before the crash.
130
131 --InIsolation|/InIsolation
132
133 Runs the tests in an isolated process. This makes vstest.console.exe
134 process less likely to be stopped on an error in the tests, but tests
135 may run slower.
136
137 @<file>
138
139 Reads response file for more options.
140
141 args
142
143 Specifies extra arguments to pass to the adapter. Arguments are speci‐
144 fied as name-value pairs of the form <n>=<v>, where <n> is the argument
145 name and <v> is the argument value. Use a space to separate multiple
146 arguments.
147
148 .NET Core 2.0
149 --Settings|/Settings:<Settings File>
150
151 Settings to use when running tests.
152
153 --Tests|/Tests:<Test Names>
154
155 Run tests with names that match the provided values. Separate multiple
156 values with commas.
157
158 --TestAdapterPath|/TestAdapterPath
159
160 Use custom test adapters from a given path (if any) in the test run.
161
162 --Platform|/Platform:<Platform type>
163
164 Target platform architecture used for test execution. Valid values are
165 x86, x64, and ARM.
166
167 --Framework|/Framework:<Framework Version>
168
169 Target .NET Framework version used for test execution. Examples of
170 valid values are .NETFramework,Version=v4.6 or .NETCoreApp,Ver‐
171 sion=v1.0. Other supported values are Framework35, Framework40, Frame‐
172 work45, and FrameworkCore10.
173
174 --Parallel|/Parallel
175
176 Execute tests in parallel. By default, all available cores on the ma‐
177 chine are available for use. Set an explicit number of cores with a
178 settings file.
179
180 --TestCaseFilter|/TestCaseFilter:<Expression>
181
182 Run tests that match the given expression. <Expression> is of the for‐
183 mat <property>Operator<value>[|&<Expression>], where Operator is one of
184 =, !=, or ~. Operator ~ has `contains' semantics and is applicable for
185 string properties like DisplayName. Parenthesis () are used to group
186 sub-expressions.
187
188 -?|--Help|/?|/Help
189
190 Prints out a short help for the command.
191
192 --logger|/logger:<Logger Uri/FriendlyName>
193
194 Specify a logger for test results.
195
196 · To publish test results to Team Foundation Server, use the TfsPub‐
197 lisher logger provider:
198
199 /logger:TfsPublisher;
200 Collection=<team project collection url>;
201 BuildName=<build name>;
202 TeamProject=<team project name>
203 [;Platform=<Defaults to "Any CPU">]
204 [;Flavor=<Defaults to "Debug">]
205 [;RunTitle=<title>]
206
207 · To log results to a Visual Studio Test Results File (TRX), use the
208 trx logger provider. This switch creates a file in the test results
209 directory with given log file name. If LogFileName isn't provided, a
210 unique file name is created to hold the test results.
211
212 /logger:trx [;LogFileName=<Defaults to unique file name>]
213
214 -lt|--ListTests|/lt|/ListTests:<File Name>
215
216 Lists all discovered tests from the given test container.
217
218 --ParentProcessId|/ParentProcessId:<ParentProcessId>
219
220 Process ID of the parent process responsible for launching the current
221 process.
222
223 --Port|/Port:<Port>
224
225 Specifies the port for the socket connection and receiving the event
226 messages.
227
228 --Diag|/Diag:<Path to log file>
229
230 Enables verbose logs for the test platform. Logs are written to the
231 provided file.
232
233 args
234
235 Specifies extra arguments to pass to the adapter. Arguments are speci‐
236 fied as name-value pairs of the form <n>=<v>, where <n> is the argument
237 name and <v> is the argument value. Use a space to separate multiple
238 arguments.
239
240 .NET Core 1.x
241 --Settings|/Settings:<Settings File>
242
243 Settings to use when running tests.
244
245 --Tests|/Tests:<Test Names>
246
247 Run tests with names that match the provided values. Separate multiple
248 values with commas.
249
250 --TestAdapterPath|/TestAdapterPath
251
252 Use custom test adapters from a given path (if any) in the test run.
253
254 --Platform|/Platform:<Platform type>
255
256 Target platform architecture used for test execution. Valid values are
257 x86, x64, and ARM.
258
259 --Framework|/Framework:<Framework Version>
260
261 Target .NET Framework version used for test execution. Examples of
262 valid values are .NETFramework,Version=v4.6 or .NETCoreApp,Ver‐
263 sion=v1.0. Other supported values are Framework35, Framework40, Frame‐
264 work45, and FrameworkCore10.
265
266 --Parallel|/Parallel
267
268 Execute tests in parallel. By default, all available cores on the ma‐
269 chine are available for use. Set an explicit number of cores with a
270 settings file.
271
272 --TestCaseFilter|/TestCaseFilter:<Expression>
273
274 Run tests that match the given expression. <Expression> is of the for‐
275 mat <property>Operator<value>[|&<Expression>], where Operator is one of
276 =, !=, or ~. Operator ~ has `contains' semantics and is applicable for
277 string properties like DisplayName. Parenthesis () are used to group
278 sub-expressions.
279
280 -?|--Help|/?|/Help
281
282 Prints out a short help for the command.
283
284 --logger|/logger:<Logger Uri/FriendlyName>
285
286 Specify a logger for test results.
287
288 · To publish test results to Team Foundation Server, use the TfsPub‐
289 lisher logger provider:
290
291 /logger:TfsPublisher;
292 Collection=<team project collection url>;
293 BuildName=<build name>;
294 TeamProject=<team project name>
295 [;Platform=<Defaults to "Any CPU">]
296 [;Flavor=<Defaults to "Debug">]
297 [;RunTitle=<title>]
298
299 · To log results to a Visual Studio Test Results File (TRX), use the
300 trx logger provider. This switch creates a file in the test results
301 directory with given log file name. If LogFileName isn't provided, a
302 unique file name is created to hold the test results.
303
304 /logger:trx [;LogFileName=<Defaults to unique file name>]
305
306 -lt|--ListTests|/lt|/ListTests:<File Name>
307
308 Lists all discovered tests from the given test container.
309
310 --ParentProcessId|/ParentProcessId:<ParentProcessId>
311
312 Process ID of the parent process responsible for launching the current
313 process.
314
315 --Port|/Port:<Port>
316
317 Specifies the port for the socket connection and receiving the event
318 messages.
319
320 --Diag|/Diag:<Path to log file>
321
322 Enables verbose logs for the test platform. Logs are written to the
323 provided file.
324
325 args
326
327 Specifies extra arguments to pass to the adapter. Arguments are speci‐
328 fied as name-value pairs of the form <n>=<v>, where <n> is the argument
329 name and <v> is the argument value. Use a space to separate multiple
330 arguments.
331
332 * * * * *
333
335 Run tests in mytestproject.dll:
336
337 dotnet vstest mytestproject.dll
338
339 Run tests in mytestproject.dll, exporting to custom folder with custom
340 name:
341
342 dotnet vstest mytestproject.dll --logger:"trx;LogFileName=cus‐
343 tom_file_name.trx" --ResultsDirectory:custom/file/path
344
345 Run tests in mytestproject.dll and myothertestproject.exe:
346
347 dotnet vstest mytestproject.dll myothertestproject.exe
348
349 Run TestMethod1 tests:
350
351 dotnet vstest /Tests:TestMethod1
352
353 Run TestMethod1 and TestMethod2 tests:
354
355 dotnet vstest /Tests:TestMethod1,TestMethod2
356
358 guardrex.
359
360
361
362 dotnet vstest command - .NET Core CLI(1)