Boost logo

Boost :

Subject: Re: [boost] [cmake] Pull request announcement
From: Peter Dimov (lists_at_[hidden])
Date: 2018-09-18 21:04:27

Roger Leigh wrote:

> CMake already provides two mechanisms for running tests:
> 1) ctest (the recommended way)
> 2) "make test" (when using the "Unix Makefiles" generator)

As far as I understand, the problem with `make test` is that it doesn't
build the tests. To build them, one does `make all test`, which (a) requires
tests to be built as part of the "all" target - which we don't want - and
(b) doesn't work with -jN. And `make all && ctest` has the problem of test
executable build errors not being part of the ctest output.

So the custom "check" target that just invokes `ctest` and depends on all
test executables is a workaround for the above.

Now all that's good and well, but what we're interested in here is:

- how do I write my CMakeLists and what do I type to run my library's tests,
the equivalent of `b2 test` from libdir


- how do I write my CMakeLists and a root CMakeLists and what do I type to
run several libraries' tests at the same time, the equivalent of `b2` from
the `status` directory

Boost list run by bdawes at, gregod at, cpdaniel at, john at