I am seriously looking at moving the build system of some existing software from scons to cmake.  Most things I want to accomplish seem easier in cmake, but there is one thing I can&#39;t work out how to do.<div><br></div>
<div>I like to have (at least some) unit test run as part of the build, e.g. when I type &#39;make&#39; then my program compiles, the tests compile and then the tests run.  This means that failing tests are equivalent to a failing build, and stops me &#39;forgetting&#39; to run &#39;make test&#39;.</div>
<div><br></div><div>I can generate my tests and and have them added to the &#39;test&#39; target easily enough, and &#39;make test&#39; works fine.  Is there a straightforward way to run tests after they are built as part of &#39;make&#39; on its own, and have a failing test cause a build failure?</div>
<div><br></div><div>I&#39;m using g++ on linux &amp; mac and Google Test as my unit testing framework, in case it make a difference to the answer.</div><div><br></div><div>Thanks very much,</div><div><br></div><div>Gavin</div>
<div><br></div>