[CMake] something like WILL_FAIL for tests that should crash

Leif Walsh leif.walsh at gmail.com
Tue Apr 24 02:07:13 EDT 2012


I have some tests that are expected to abort.  Imagine something like:

#include <assert.h>
int main(void) {
    assert(0);
    return 0;
}

If I put this test into cmake and set the test's property WILL_FAIL to TRUE, it fails with "Exception: Other".  I'm writing C, so I don't have exceptions, but cmake seems to interpret an abort() as an exception.  I can't find anything to tell cmake/ctest that a test is supposed to abort().  Is there such a thing?

-- 
Cheers,
Leif



More information about the CMake mailing list