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'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 'make' 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 'forgetting' to run 'make test'.</div>
<div><br></div><div>I can generate my tests and and have them added to the 'test' target easily enough, and 'make test' works fine. Is there a straightforward way to run tests after they are built as part of 'make' on its own, and have a failing test cause a build failure?</div>
<div><br></div><div>I'm using g++ on linux & 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>