[CMake] RUN_TESTS project & dependencies

John Drescher drescherjm at gmail.com
Fri Mar 20 16:54:34 EDT 2009


On Fri, Mar 20, 2009 at 4:50 PM, Robert Dailey <rcdailey at gmail.com> wrote:
> On Fri, Mar 20, 2009 at 9:33 AM, Marcel Loose <loose at astron.nl> wrote:
>>
>> Hi Robert,
>>
>> I am planning to use (but haven't implemented and tried yet):
>>
>> - add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND})
>>  to define a custom 'check' target (as with GNU Autotools)
>>
>> - add_executable(<testprog> EXCLUDE_FROM_ALL ...)
>>  for each test program
>>
>> - add_dependencies(check <testprog>)
>>  for each <testprog> you want to be compiled, linked and run
>>
>> Hope it helps.
>
I am going to have to look into that myself. I had the same issue when
developing unit tests and it drove me nuts because I fixed a bug in my
software and expected the unit test to pass only to have it still fail
and then I spent an hour trying to figure out how on earth my new fix
was bad only to find out that the executable for the unit test was
from the previous day...

John


More information about the CMake mailing list