Some CMake tests using PASS_REGULAR_EXPRESSION should also fail for non-zero exit code.
It is the case with some tests in the art suite (e.g.
ProductMix_r1c2) that specific output is expected in addition to a non-zero exit code. Unfortunately, using
PASS_REGULAR_EXPRESSION causes CTest to ignore the exit code of the test program. This may lead to tests passing when in fact they should have failed.
One solution for art invocations would be, where the required output is from message logger output, to configure the message logger to mirror output to a second, file destination, and make verifying the output of that file a second test, depending on the first.
The general solution is to write a wrapper script which handles the checking of the output and is configurable to
OR the exit code with the result of the output check as appropriate. This should probably be integrated into