On 7/26/2017 4:39 PM, Niall Douglas 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 !
Actually cmake's support for fail tests is richer than Boost.Build's.
Here is cmake to implement simple compile fail testing where a regex on the error messages from the compiler must be matched for the test to pass:
https://github.com/ned14/quickcpplib/blob/master/cmakelib/QuickCppLibMakeSta...
Thanks ! I will look at it. It does seem like a great deal of code just to run a bunch of tests.
This cmake reads the regex from the first line of the fail test's source code.
There is lots of flexibility in cmake's fail test design. You can make tests which must compile but must fail to link. You can make tests which must complete within a certain time period. Lots of flexibility.
ctest generates XML of all the test results. That can be merged with JUnit XML from the individual tests easily enough. And the whole lot sent up to CDash e.g. http://my.cdash.org/index.php?project=Boost.Outcome&date=2017-07-23 where fails and successes can be drilled into, and the cause figured out.
I have a feeling that CTest is not usable for the current Boost testing system, but maybe I am wrong.
Niall