简体   繁体   中英

How to force visual studio build fail after unit tests failed

Currently, I am using Visual Studio 2012 and automate unit test execution after each build. However, what I would to do is fail the build if a single unit test fails . The following steps are what I want to do

  1. Build the solution
  2. When (1) succeed, run all unit tests automatically
  3. When at step 2, if a unit test fails, make the build fail

I am able to do 1 and 2 ( which are out of the box), but don't know how for step 3. This is for local build

You can add Nunit or whatever framework execution as msbuild task in your project file. Here is an example:

http://sachabarbs.wordpress.com/2013/05/28/msbuild-and-nunit-a-simple-example/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM