Visual Studio 2010 CxxTest: Fail build if test fails

215 views Asked by At

I have a solution full of C++ projects. I want to stop building and running the projects once the first project fails (aka bad exit status). In a GNU Makefile I could easily accomplish this. How do I do this in Visual Studio?

  1. Run a Program as Part of Build
  2. Get Exit Status
  3. Fail Build if Exit Status != 0

inside of Visual Studio 2010 or higher.

1

There are 1 answers

0
Matthew Hoggan On

Digging around MSDN and StackOverflow for a bit I came up with:

"$(TargetDir)$(TargetName).exe" if ERRORLEVEL > 0 goto EXIT

As a post build command