Boost logo

Boost :

From: Joe Van Dyk (joevandyk_at_[hidden])
Date: 2006-07-09 22:15:19


On 7/9/06, Marc Mutz <marc_at_[hidden]> wrote:
> On Friday 07 July 2006 04:40, Joe Van Dyk wrote:
> > I'm trying to get something like the following to work:
> >
> > test_case1.cpp and test_cast2.cpp are compiled into a static library
> > (libtest.a). They use BOOST_AUTO_TEST_CASE for test cases.
> >
> > test_main.cpp contains:
> > #define BOOST_AUTO_TEST_MAIN
> > #include <boost/test/auto_unit_test.hpp>
> >
> > However, when I compile test_main.cpp and link libtest.a into it, none
> > of the test cases run.
> >
> > The test cases do run if test_main.cpp #includes test_case1.cpp and
> > test_case2.cpp, but I'd rather not do that if it's not necessary.
> >
> > Any ideas?
> <snip>
>
> I'm guessing here :)
> Registration of tests with the runner is done using file-static instances of
> some generic factory or other registration mechanism. If none of the symbols
> of given object file is referenced outside itself, the linker does not
> include the code from the object file in the final executable. Use dynamic
> libs, or link the object files instead of the archives.

Hm, I'll try that. I don't think that fits as nicely into our build
system, but I'll have to check on Monday.

Can anyone else chime in on this?

Thanks for the information,
Joe


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