Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2006-07-10 02:25:40


"Joe Van Dyk" <joevandyk_at_[hidden]> wrote in message
news:c715e640607091915m2142172bo6d437e4c04d7ff5b_at_mail.gmail.com...
> 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.

This could be the reason. But to employ the dynamic build you will need
current CVS version. 1.33.1 won't work.

> 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?

Maybe you could use some compiler options to avoid unused static files
discard?

Gennadiy


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