Subject: Re: [boost] CMake and Boost Build tests
From: Robert Ramey (ramey_at_[hidden])
Date: 2017-07-26 19:33:17
On 7/26/17 11:49 AM, Edward Diener via Boost wrote:
> Following John Maddock's appeal for practical solutions related to the
> move to CMake, I would like to know what the CMake equivalent is to the
> Boost Build unit test functionality.
I can tell you what I did for the serialization library. This predates
the current discussions so will likely be considered out of date by the
current contributors to the discussion. On the other hand, it does
actually work and you can test it yourself.
> In other words what do I write for CMake in order to do a Boost Build
> compile, compile-fail, link, link-fail, run, and run-fail unit tests ?
One adds targets (which for me is just the name of the source/excutable
without the cpp, exe, etc. to a list to get compile and run
functionality. Its pretty simple.
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.
> Does CMake have an equivalent to the Boost Build alias rule ? or the
> Boost Build project rule ?
LOL - I honestly don't remember what these rules do in boost build. But
then I've only been using boost build for 15 years.
> The great majority of the Boost libraries are header-only libraries
> where Boost Build is used to run the unit tests and,
true and this case is pretty simple in both cmake and boost build.
> optionally, Boost
> Build is used to build the documentation using a quickbook, boostbook,
> doxygen toolset to generate html and pdf files.
Personally, I could never make this tool chain work despite a large
investment of effort. I gave up on doxygen and quickbook after
concluding them to be essentially non-functional. I did manage to use
the xml tools loaded with boost tools along with some downloaded FOP, a
version of XMLMind to create toolchain which is about 100 times better
and 1/100 as complex as the boost one for creating documents. So you're
life will be better when you're forced to leave these behind.
While I realize that
> building a Boost library, and making that built library available to
> end-users via CMake, has been the focus of most of the discussion so far
> regarding CMake and Boost,
You are correct. There are two independent issues related to this.
a) Replacing boost build with cmake
b) providing CMake files to be helpful to users who use CMake to build
Boost should first address b) first while leaving a) untouched for now.
If it can't manage to do that, then there is not point in trying to
I am assuming the move to CMake also means that running unit tests
I think that is the goal
and building docs where applicable must also be done through CMake.
I don't see this as a requirement nor do I see it as necessary or desirable.
> If I am wrong about this then I personally will be
> only too happy to continue using Boost Build to do these things.
LOL - it certainly looks that way.
I wouldn't panic yet. Nothing is actually going to happen until someone
actually does something (besides offer advice). It doesn't seem that
that is going to happen very soon, so you can just relax.
But you might want to experiment a little with the following useful
a) investigate how CMake Find<your library> should work and consider
adding the files necessary to support it to your library. This wouldn't
mess up any of your other work.
b) Consider making a simple CMake project to build library and run tests
such as I did for the serialization library. CMake gurus it seems
dismiss this effort. But it has worked for me. The main benefit for me
is that permits to to build a working IDE which I can used to build and
debug. For me, this has turned out to be a great time saver.
Also I use boost build for running unit tests on my local system and it
works very well for that. It's what I really depend on. It doesn't
consume any effort to maintain (it was a MAJOR effort to setup). And I
created my own program to display test results (library_test) so I'm
very happy with this. One thing that CMake has that Boost Build doesn't
have is CDash does have is the ability to upload test results to a
special site where all test results from all users can be browsed. This
is desperately needed for Boost but no one has made the effort to build it.
So all in all, I'm hoping that we can evolve to something better and
more widely useful. But I don't see anyone actually undertaking efforts
to make that happen. So I don't think you and I really have to worry
about this all that much. We'll Boost build will likely out live you
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk