Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are several ways you can have your test cases run. One way is to add an invoke process or Exec Command to your build project file or workflow. Place the call to mstest in the AfterBuild target or workflow step. The other way would be to separate out the build and test cases into different builds.</p> <p>Here are a couple of links to get you started:</p> <p><a href="http://msdn.microsoft.com/en-us/library/ms182465%28v=vs.100%29.aspx" rel="nofollow">How to: Configure and Run Scheduled Tests After Building Your Application</a></p> <p><a href="http://social.msdn.microsoft.com/Forums/en/msbuild/thread/cb87a184-6589-454b-bf1c-2e82771fc3aa" rel="nofollow">Example of MSBuild with MSTest</a></p> <p>*Based on your comments here is an update of something you can do to get more information about the error or to continue if you encounter an error. You do not need to check for the error code if you just want to stop on any error but if you do want to check the error code then you would do something like this:</p> <pre><code>&lt;Target Name="AfterBuild"&gt; &lt;Message Text="Running tests..." /&gt; &lt;PropertyGroup Label="TestSuccessOrNot"&gt; &lt;TestSuccessOrNot&gt;5&lt;/TestSuccessOrNot&gt; &lt;/PropertyGroup&gt; &lt;!-- Run MSTest exe--&gt; &lt;Exec Command="cd ." IgnoreExitCode="False" ContinueOnError="ErrorAndContinue"&gt; &lt;Output TaskParameter="ExitCode" PropertyName="TestSuccessOrNot" /&gt; &lt;/Exec&gt; &lt;Message Text="ExitCode = $(TestSuccessOrNot)" /&gt; &lt;Error Condition="'$(TestSuccessOrNot)' != '0'" Text="Unit tests fail!" /&gt; &lt;/Target&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload