[CMake] ctest - run commands before and after tests run

Crni Gorac cgorac at gmail.com
Mon Oct 22 12:55:25 EDT 2012


At "CMake/Testing With CTest" Wiki page
(http://www.cmake.org/Wiki/CMake_Testing_With_CTest), it is mentioned
that:

CTest has several additional features that include:
...
    Customization of the testing by providing:
...
      Ability to run commands before and after tests are run

I need to do something alike: to be able to run small program before
any of tests are run on "make test", that will gather some system info
(in my particular case, number of GPUs available on system), and then
make this info somehow available (best way would be through command
line arguments) to test programs specified in my add_test() commands.
Is this possible, and how?

Thanks.


More information about the CMake mailing list