Boost logo

Boost :

Subject: Re: [boost] CMake and Boost Build tests
From: Roger Leigh (rleigh_at_[hidden])
Date: 2017-07-26 20:48:03


On 26/07/17 21:28, Edward Diener via Boost wrote:
> On 7/26/2017 3:33 PM, Robert Ramey via Boost wrote:
>> On 7/26/17 11:49 AM, Edward Diener via Boost wrote:

>> I couldn't make the compile-fail and run-fail targets to work so I
>> just removed them from the cmake test suite. So if your thinking that
>> CMake has a ways to go to be able to offer what we expect, you're right.
>
> So you are saying that you cannot run a unit test with CMake that is
> meant to show a failure. Wow, what a brilliant system !

ctest itself treats a nonzero return as failure. It's pretty trivial to
run a wrapper to invert the status for expected failures, and customise
the test running in any way you see fit. See the EXPECT_FAIL lines in

https://github.com/apache/xerces-c/blob/f7654ee16b1dc2fb6e2b68777895c5384cd51c28/tests/CMakeLists.txt#L176

and the wrapper logic in

https://github.com/apache/xerces-c/blob/f7654ee16b1dc2fb6e2b68777895c5384cd51c28/cmake/RunTest.cmake#L45

as one way to do this.

Regards,
Roger


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk