Boost logo

Boost Users :

Subject: Re: [Boost-users] [test] Standalone use with multiple translation units?
From: Adam Nielsen (a.nielsen_at_[hidden])
Date: 2016-05-20 19:49:26

> > since the Test library broke backwards compatibility with 1.59, my
> > code will no longer compile on versions earlier than 1.59.
> Which specific part?

The boost::unit_test::make_test_case() function got some extra
parameters. I guess I could use #ifdefs and have two different
versions of the function call, but that does get messy quickly.

> This is actually not that difficult it seems. In one translation unit define
> BOOST_TEST_MODULE and use inlined header:
> #define BOOST_TEST_MODULE single header multiunit test
> #include <boost/test/included/unit_test.hpp>
> in all other translation units just do this:
> #include <boost/test/unit_test.hpp>

Oh that looks easy, I will try that! Many thanks,


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at