Boost logo

Boost :

Subject: Re: [boost] [cmake] Pull request announcement
From: Alexander Grund (alexander.grund_at_[hidden])
Date: 2018-09-17 11:09:15


>> This won't be to bad either once the variants problem above is
>> solved. CTest is quite powerful so except for a few corner cases I
>> expect it to be straight forward.
>
> CTest has absolutely no notion of compile-time testing. This was
> mentioned to CMake on their mailing list a long time ago and got the
> usual yawns from the CMake people.
This is not entirely true. I myself did write such tests. It is simply
an invocation of "${CMAKE_COMMAND} --build . --config $<CONFIG> --target
..." added with `add_test` and setting the property `WILL_FAIL` to TRUE.
I even went a step further and added a macro which will add 2 targets,
where one as a preprocessor macro defined. The test then checks that
compilation succeeds when the macro is not defined and it doesn't when
it is. This makes sure the "faulty" code is indeed the source of error.
You could also use a regex to match the error.

Yes this is not as straight forward as it could be, but neither is the
way in bjam: You need to call some macro/function/... and that does the
magic.




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