title: Have make fail if unit tests fail
body: <p>I have a makefile for compiling a static library. This makefile has a rule for compiling a unit test suite associated with the static library. Once the test suite is compiled, a python script is invoked to run the tests and log the results. It looks like this:</p>
  
  <pre><code>unit:
      $(MAKE) -C cXbase/unit
      python $(TESTS_RUNNER) $(UNIT_TESTS_EXEC) $(UNIT_TESTS_LOG)
  </code></pre>
  
  <p>I use Python to make the tests invocation portable. Right now, everything works fine: the tests compile and the test runner is called and logs everything properly in Linux and Windows. Only, when a test fail, I would like to stop the whole make process and return an error. More precisely, I would like not to be able to <code>make all</code> or to <code>make unit</code> when a unit test fails (or many).</p>
  
  <p>If a unit test fails, the Python script returns a specific exit code. I would like to be able to <strong>capture it in a portable way</strong> and have make fail if that exit code is captured.</p>
  
  <p>Would you have any recommendations on how to do this? I have found nothing convincing or portable elsewhere.</p>
  
  <p>Thanks</p>