How to run ALL tests in my solution using command line MSTest.exe?

Viewed 31351

According to MSDN here and discussed here, we can use MSTest.exe to run tests from command line - which is sweet and faster than running within the IDE (especially slow if you are working on a big solution like me).

My question is how can I use MSTest.exe to run all tests in my solution? The command only have the /test option to filter the tests in one assembly specified in /container option. I only can think of calling this command N times given that I can have all the N test assembly in my solution (!?) Moreover, the results after run are per-assembly basics so that it's not easy to get what tests were failed/passed.

If you know a better way, please share! Thank you!

4 Answers

Just use:

mstest.exe /testcontainer:yourTests.dll /resultsfile:res.trx

and it will run all tests in that assembly, and spit out the results in the specified file.

Related