Boost logo

Boost Users :

Subject: Re: [Boost-users] [test] manual test suite initialization: linking problems
From: Matthias Vallentin (vallentin_at_[hidden])
Date: 2009-07-16 03:08:28


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 <boost/test/unit_test.hpp>

    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_at_[hidden]
http://www.icir.org/matthias

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