title: How can I use cmake to test processes that are expected to fail with an exception? (e.g., failures due to clang's address sanitizer)
body: <p>I've got some tests that test that clang's address sanitizer catch particular errors. (I want to ensure my understanding of the types of error it can catch is correct, and that future versions continue to catch the type of errors I'm expecting them to.) This means I have several tests that fail by crapping out with an <code>OTHER_FAULT</code>, which appears to be the fixed way that clang's runtime reports an error.</p>
  
  <p>I've set the <code>WILL_FAIL</code> flag to <code>TRUE</code> for these tests, but this only seems to check the return value from a successful, exception-free failure. If the process terminates with an exception, cmake still classes it as a failure.</p>
  
  <p>I've also tried using <code>PASS_REGULAR_EXPRESSION</code> to watch for the distinguishing messages that are printed out when this error occurs, but again, cmake seems to class the test as a failure if it terminates with an exception.</p>
  
  <p>Is there anything I can do to get around this?</p>
  
  <p>(clang-specific answers are also an option! - but I doubt this will be the last time I need to test something like this, so I'd prefer to know how to do it with cmake generally, if it's possible)</p>