I have 5 solutions all using MSTest and I would like to have a cmd file in a root folder that will run all the tests
so I would like to call the MsTests runner from the command line against
\Solution1\Tests\Debug\Test.dll
...
\Solution5\Tests\Debug\Test.dll
anybody knows how can this be done ?
Add the folder that contains MSTest.exe to your path variable and restart the execution server. The default path is: C:\Program Files (x86)\Microsoft Visual Studio <version>\Common7\IDE.
Tests can be run from Test Explorer by right-clicking in the code editor on a test and selecting Run test or by using the default Test Explorer shortcuts in Visual Studio.
If Using .Net Core:
dotnet test ./nameoftest.dll
In the folder where the test is located.
For command line options see: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test
This is detailed on MSDN: How to: Run Automated Tests from the Command Line Using MSTest
Basically, you can do:
MSTest /testcontainer:\Solution1\Tests\Debug\Test.dll
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With