[CMake] How to run CTEST_CUSTOM_(PRE|POST)_TEST for *every* test

Marcel Loose loose at astron.nl
Mon Feb 1 06:26:05 EST 2010


Hi all,

I was looking for a way to setup and tear-down a test-run environment
separately for every test that I'm running.

Currently, our tests are started using a special script that handles
this. However, the problem with this setup is that I cannot do a 'ctest
-D MemoryCheck', because that will not memory-check my test program, but
the wrapper script instead. So I was looking for a way to do this setup
and tear-down in the pre-test and post-test phase. Is this possible at
all?

Another "interesting" problem to solve is that the current test wrapper
script also analyses the output of a test program and compares it to a
reference output, in order to decide if the test succeeded or failed.
Would it be possible to do this in a post-test phase?

The main goal I'm trying to achieve here is to make it possible to
memory-check my test programs, ideally using 'ctest -D MemoryCheck'.

Best regards,
Marcel Loose.




More information about the CMake mailing list