Reputation: 622
I am aiming to find a way to run the tests contained in a group of assemblies from command line.
The tests have been built using Visual Studio Testing Framework and the assemblies are all located in the same folder.
What I want to extract are the tests results (especially the list of failed ones) and possibly the code coverage.
Upvotes: 0
Views: 1426
Reputation: 1991
You can use the vstest.console.exe program, it is documented here: https://msdn.microsoft.com/en-us/library/jj155796.aspx It outputs the results to the console, which you can pipe to a file if you like. It can also log the output to a trx test file, which can be opened in Visual Studio and viewed there.
Use it as: vstest.console file1.test.dll file2.test.dll /logger:trx > testresults.txt
It does not accept wildcards for the filenames, but you can wrap it in a powershellscript to achieve that, if you like.
If you add the /EnableCodeCoverage option, you also get a .coverage file, which you also can open up in Visual Studio.
Upvotes: 1