Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute Unit Tests using MsBuild command line

I use scripting for this:

 "%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\TF.exe"    get $/DmlOnDemmand /recursive /force /noprompt 

And I build solution .sln

 call %msBuildDir%\msbuild %solutionName% /t:Rebuild /p:Configuration=%buildType% 

Now, I would like execute all Unit Tests and check all is OK.

How can I execute unit tests of .csproj projects of a solution from the command line using a build tool like MSBuild?

like image 496
Kiquenet Avatar asked Oct 22 '10 11:10

Kiquenet


People also ask

How use MSBuild command line?

To run MSBuild at a command prompt, pass a project file to MSBuild.exe, together with the appropriate command-line options. Command-line options let you set properties, execute specific targets, and set other options that control the build process.

How do I run MSTest from command line?

Use the command MSTest from the command prompt. The MSTest command expects the name of the test as parameter to run the test. Just type MSTest /help or MSTest /? at the Visual Studio command prompt to get help and find out more about options.


1 Answers

Look at VSTest.Console.EXE they added this for CodedUI tests. Seems to have more functionality. https://msdn.microsoft.com/en-us/library/jj155800.aspx in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow directory.

like image 164
Mark Rowe Avatar answered Sep 21 '22 23:09

Mark Rowe