[CMake] Need WILL_FAIL_ASSERTION or equivalent.

Chris Green greenc at fnal.gov
Wed Mar 2 11:42:41 EST 2011


Hi,

I find myself needing to count a test that I expect to fail an assertion
(I'm using CMake 2.8.4). My first attempt, using the test property
WILL_FAIL, erm, failed because apparently an abort is trapped as an
exception rather than a failing execution.

I have worked around this for now by writing a wrapper script, but can I
suggest two enhancements (assuming this behavior isn't implemented
somewhere I haven't found)?

   1. WILL_FAIL be enhanced to take a number as well as true (if this is
      possible) such that if a number is passed then that is the error
      code expected and anything else is a failure.
   2. A new property WILL_FAIL_ASSERTION which can be either true or a
      regular expression specifying the particular assertion to be
      expected, with anything else (even another assertion) being a test
      failure.

Of course, anything that provides the desired behavior (preferably by
specifying a test property) would be perfectly fine: the above are
merely suggestions.

Thanks,
Chris.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110302/a0d14035/attachment.htm>


More information about the CMake mailing list