I found an old thread [1] from 2007where it is advised to use the
following combination if one wants to use dynamic linking and manual
registration:
If you insist on combination of manual registration with shared library, it
should look like this:
int
main( int argc, char* argv[] )
{
return ::boost::unit_test::unit_test_main( &init_unit_test, argc, argv );
}
Is this still the way to do it? I tried to apply the technique as
follows:
#define BOOST_TEST_DYN_LINK
#define BOOST_TEST_ALTERNATIVE_INIT_API
#include
void test() { }
bool init_unit_test()
{
boost::unit_test::test_suite* ts = BOOST_TEST_SUITE("test suite");
ts->add(BOOST_TEST_CASE(&test));
boost::unit_test::framework::master_test_suite().add(ts);
return true;
}
int main(int argc, char* argv[])
{
return ::boost::unit_test::unit_test_main(&init_unit_test, argc, argv);
}
That, however, gives me the following run-time error:
Running Test setup error: signal: SIGABRT (application abort requested)
Any help would is appreciated.
Matthias
[1] http://archives.free.net.ph/message/20071221.075140.82d00074.en.html
--
Matthias Vallentin
vallentin@icsi.berkeley.edu
http://www.icir.org/matthias