[CMake] Defining dependent compile and run tests using CMake/CTest

Neil Carlson neil.n.carlson at gmail.com
Sun Nov 26 10:49:07 EST 2017


I have a test code (think compiler regression test) that want to compile as
a test, and if it compiles and links successfully, to go on to run as a
subsequent test.  I found a thread from Sept that pointed to a method used
in boost-cmake for the first compile test.  It moves execution of the
compile/link from the make step to the ctest step, and works great.  I'm
now using the FIXTURES_REQUIRED and FIXTURES_SETUP test properties to make
the run test depend on the successful completion of the compile test, but
this doesn't seem to be working properly.  It does order the tests so that
the compile test is done first, However if it fails, ctest spews a long
message for the run test detailing all the places it looked for the
executable (not created because the compile/link test failed) but could not
find.  It's as if ctest tries to set up the test before checking to see
whether it should be run at all.  Am I doing something incorrect here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20171126/383f8e93/attachment.html>


More information about the CMake mailing list