[CMake] Unit tests, but not CTest

Erik Johansson erik at ejohansson.se
Wed May 5 01:52:04 EDT 2010


On Tue, Apr 27, 2010 at 15:47, Magnus Therning <magnus at therning.org> wrote:
> Except of course that it will take away one of the things I *really*
> want, which is that all unit tests are run every time I compile.
>
> It seems at the moment I'll have to write a stand-alone script to get
> that behaviour :-(

I use this:
add_custom_target(tests ALL COMMAND ${CMAKE_CTEST_COMMAND} $(ARGS))

With that all tests are run as part of the build and if one would fail
I can run "make tests ARGS=-V" to get all output.

// Erik

-- 
Erik Johansson
Home Page: http://ejohansson.se/
PGP Key: http://ejohansson.se/erik.asc


More information about the CMake mailing list