Boost logo

Boost Users :

Subject: [Boost-users] Boost.Test multiple linkage question
From: Rob Harris (rob.harris_at_[hidden])
Date: 2014-09-18 14:31:21


All,

I've been ripping out my hair all day, and I can't seem to determine a
straight answer from the Googles.

Can I link _multiple_ boost unit test dynamic libraries into a single
binary and have all of them detected?

For instance...

src
   lib
     liba
       foo.cpp
       liba_unittests.cpp
     libb
       bar.cpp
       libb_unittests.cpp
     libd
       baz.cpp
       libd_unittests.cpp
lib
   liba.so
   liba_ut.so
   libb.so
   libb_ut.so
   libd.so
   libd_ut.so
bin
   ut
     unittest_driver

When I build this infrastructure out, everything compiles. I've checked
the compilation command and it looks like everything is on the command
line, but there's explicit indication that unittest_driver actually read
or linked any of the lib*_ut.so files.

If I make individual unit test drivers in, say, liba, the driver works
fine.

If I link everything into a single unittest_driver binary, I keep
getting the dreaded empty test tree.

I have -DBOOST_ALL_DYN_LINK set in my CXXFLAGS so that shouldn't be the
problem. And I only have BOOST_TEST_MAIN set in the driver; still no joy.

Any help (or a definitive, "no you idiot, you can't do that!") would be
greatly appreciated. Thanks.
-RMH


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net