.\" Automatically generated by Pandoc 2.14.1 .\" .TH "" "1" "" "" ".NET" .hy .SH dotnet vstest .PP \f[B]This article applies to:\f[R] \[u2714]\[uFE0F] .NET Core 2.1 SDK and later versions .RS .PP [!IMPORTANT] The \f[C]dotnet vstest\f[R] command is superseded by \f[C]dotnet test\f[R], which can now be used to run assemblies. See \f[C]dotnet test\f[R]. .RE .SH NAME .PP \f[C]dotnet-vstest\f[R] - Runs tests from the specified assemblies. .SH SYNOPSIS .IP .nf \f[C] dotnet vstest [] [--Blame] [--Diag ] [--Framework ] [--InIsolation] [-lt|--ListTests ] [--logger ] [--Parallel] [--ParentProcessId ] [--Platform] [--Port ] [--ResultsDirectory] [--Settings ] [--TestAdapterPath ] [--TestCaseFilter ] [--Tests ] [[--] ...]] dotnet vstest -?|--Help \f[R] .fi .SH DESCRIPTION .PP The \f[C]dotnet-vstest\f[R] command runs the \f[C]VSTest.Console\f[R] command-line application to run automated unit tests. .SS Arguments .IP \[bu] 2 \f[B]\f[CB]TEST_FILE_NAMES\f[B]\f[R] .RS 2 .PP Run tests from the specified assemblies. Separate multiple test assembly names with spaces. Wildcards are supported. .RE .SH OPTIONS .IP \[bu] 2 \f[B]\f[CB]--Blame\f[B]\f[R] .RS 2 .PP Runs the tests in blame mode. This option is helpful in isolating the problematic tests causing test host to crash. It creates an output file in the current directory as \f[I]Sequence.xml\f[R] that captures the order of tests execution before the crash. .RE .IP \[bu] 2 \f[B]\f[CB]--Diag \f[B]\f[R] .RS 2 .PP Enables verbose logs for the test platform. Logs are written to the provided file. .RE .IP \[bu] 2 \f[B]\f[CB]--Framework \f[B]\f[R] .RS 2 .PP Target .NET Framework version used for test execution. Examples of valid values are \f[C].NETFramework,Version=v4.6\f[R] or \f[C].NETCoreApp,Version=v1.0\f[R]. Other supported values are \f[C]Framework40\f[R], \f[C]Framework45\f[R], \f[C]FrameworkCore10\f[R], and \f[C]FrameworkUap10\f[R]. .RE .IP \[bu] 2 \f[B]\f[CB]--InIsolation\f[B]\f[R] .RS 2 .PP Runs the tests in an isolated process. This makes \f[I]vstest.console.exe\f[R] process less likely to be stopped on an error in the tests, but tests may run slower. .RE .IP \[bu] 2 \f[B]\f[CB]-lt|--ListTests \f[B]\f[R] .RS 2 .PP Lists all discovered tests from the given test container. .RE .IP \[bu] 2 \f[B]\f[CB]--logger \f[B]\f[R] .RS 2 .PP Specify a logger for test results. .IP \[bu] 2 To publish test results to Team Foundation Server, use the \f[C]TfsPublisher\f[R] logger provider: .RS 2 .IP .nf \f[C] /logger:TfsPublisher; Collection=; BuildName=; TeamProject= [;Platform=] [;Flavor=] [;RunTitle=] \f[R] .fi .RE .IP \[bu] 2 To log results to a Visual Studio Test Results File (TRX), use the \f[C]trx\f[R] logger provider. This switch creates a file in the test results directory with given log file name. If \f[C]LogFileName\f[R] isn\[cq]t provided, a unique file name is created to hold the test results. .RS 2 .IP .nf \f[C] /logger:trx [;LogFileName=<Defaults to unique file name>] \f[R] .fi .RE .RE .IP \[bu] 2 \f[B]\f[CB]--Parallel\f[B]\f[R] .RS 2 .PP Run tests in parallel. By default, all available cores on the machine are available for use. Specify an explicit number of cores by setting the \f[C]MaxCpuCount\f[R] property under the \f[C]RunConfiguration\f[R] node in the \f[I]runsettings\f[R] file. .RE .IP \[bu] 2 \f[B]\f[CB]--ParentProcessId <PROCESS_ID>\f[B]\f[R] .RS 2 .PP Process ID of the parent process responsible for launching the current process. .RE .IP \[bu] 2 \f[B]\f[CB]--Platform <PLATFORM_TYPE>\f[B]\f[R] .RS 2 .PP Target platform architecture used for test execution. Valid values are \f[C]x86\f[R], \f[C]x64\f[R], and \f[C]ARM\f[R]. .RE .IP \[bu] 2 \f[B]\f[CB]--Port <PORT>\f[B]\f[R] .RS 2 .PP Specifies the port for the socket connection and receiving the event messages. .RE .IP \[bu] 2 \f[B]\f[CB]--ResultsDirectory:<PATH>\f[B]\f[R] .RS 2 .PP Test results directory will be created in specified path if not exists. .RE .IP \[bu] 2 \f[B]\f[CB]--Settings <SETTINGS_FILE>\f[B]\f[R] .RS 2 .PP Settings to use when running tests. .RE .IP \[bu] 2 \f[B]\f[CB]--TestAdapterPath <PATH>\f[B]\f[R] .RS 2 .PP Use custom test adapters from a given path (if any) in the test run. .RE .IP \[bu] 2 \f[B]\f[CB]--TestCaseFilter <EXPRESSION>\f[B]\f[R] .RS 2 .PP Run tests that match the given expression. \f[C]<EXPRESSION>\f[R] is of the format \f[C]<property>Operator<value>[|&<EXPRESSION>]\f[R], where Operator is one of \f[C]=\f[R], \f[C]!=\f[R], or \f[C]\[ti]\f[R]. Operator \f[C]\[ti]\f[R] has `contains' semantics and is applicable for string properties like \f[C]DisplayName\f[R]. Parentheses \f[C]()\f[R] are used to group subexpressions. For more information, see TestCase filter (https://github.com/Microsoft/vstest-docs/blob/master/docs/filter.md). .RE .IP \[bu] 2 \f[B]\f[CB]--Tests <TEST_NAMES>\f[B]\f[R] .RS 2 .PP Run tests with names that match the provided values. Separate multiple values with commas. .RE .IP \[bu] 2 \f[B]\f[CB]-?|--Help\f[B]\f[R] .RS 2 .PP Prints out a short help for the command. .RE .IP \[bu] 2 \f[B]\f[CB]\[at]<file>\f[B]\f[R] .RS 2 .PP Reads response file for more options. .RE .IP \[bu] 2 \f[B]\f[CB]args\f[B]\f[R] .RS 2 .PP Specifies extra arguments to pass to the adapter. Arguments are specified as name-value pairs of the form \f[C]<n>=<v>\f[R], where \f[C]<n>\f[R] is the argument name and \f[C]<v>\f[R] is the argument value. Use a space to separate multiple arguments. .RE .SH EXAMPLES .PP Run tests in \f[I]mytestproject.dll\f[R]: .IP .nf \f[C] dotnet vstest mytestproject.dll \f[R] .fi .PP Run tests in \f[I]mytestproject.dll\f[R], exporting to custom folder with custom name: .IP .nf \f[C] dotnet vstest mytestproject.dll --logger:\[dq]trx;LogFileName=custom_file_name.trx\[dq] --ResultsDirectory:custom/file/path \f[R] .fi .PP Run tests in \f[I]mytestproject.dll\f[R] and \f[I]myothertestproject.exe\f[R]: .IP .nf \f[C] dotnet vstest mytestproject.dll myothertestproject.exe \f[R] .fi .PP Run \f[C]TestMethod1\f[R] tests: .IP .nf \f[C] dotnet vstest /Tests:TestMethod1 \f[R] .fi .PP Run \f[C]TestMethod1\f[R] and \f[C]TestMethod2\f[R] tests: .IP .nf \f[C] dotnet vstest /Tests:TestMethod1,TestMethod2 \f[R] .fi .SS See also .IP \[bu] 2 VSTest.Console.exe command-line options