In Visual Studio 2019, What Command is Run When 'Test All' is Clicked?

666 Views Asked by At

Visual Studio 2019 (and most Visual Studios that I've worked with that have a Test Explorer) have a 'Test All' button.

enter image description here

I'm curious as to what the CLI-equivalent command is run when this is clicked (including all options fed to this command). For example, dotnet test .... I'm sure the --no-build option is not specified, as clicking this button runs a build. Does anyone know what the entire command that is run is?

1

There are 1 best solutions below

0
Jonathan Dodds On

If you are looking to replicate the function of the Test Explorer at the command line then for Visual Studio on Windows, "VSTest.Console.exe is the command-line tool to run tests." Within Testing tools in Visual Studio, see Run tests from the command line.

The IDE, however, is not spawning new vstest.console processes on every test run. It is 're-using' existing test runner instances via an API/protocol.