[Test] main for BOOST_TEST_DYN_LINK with manual registration
From reading [1] and [2], one needs to provide a main() that invokes
What from example 15 from the Boost.Test "Manually registered test
suites" documentation[1] needs to change if instead of
#include
What from example 15 from the Boost.Test "Manually registered test suites" documentation[1] needs to change if instead of #include
one used #define BOOST_TEST_DYN_LINK #include ? [1] http://www.boost.org/doc/libs/1_49_0/libs/test/doc/html/utf/user-guide/test-...
This appears to work but I would certainly appreciate a prettier solution... #ifdef BOOST_TEST_ALTERNATIVE_INIT_API bool init_unit_test() { #else ::boost::unit_test::test_suite* init_unit_test_suite( int, char* [] ) { #endif // Register some stuff #ifdef BOOST_TEST_ALTERNATIVE_INIT_API return true; } #else return 0; } #endif int main( int argc, char* argv[] ) { #ifdef BOOST_TEST_ALTERNATIVE_INIT_API return ::boost::unit_test::unit_test_main( &init_unit_test, argc, argv ); #else return ::boost::unit_test::unit_test_main( &init_unit_test_suite, argc, argv ); #endif } Regardless of the prettiness of the solution, this would be helpful to include in the manual at http://www.boost.org/doc/libs/1_49_0/libs/test/doc/html/utf/user-guide/test-... - Rhys
participants (1)
-
Rhys Ulerich