
Stephen Torri
Why in the heck did the boost unit test framework change to remove main?
Shared lib version of Boost.Test does not include main for portability reasons. You can search for very long discussion on this topic in the mailing list.
Why does the documentation not reflect this? Why are the example describing the old behavior? How am I now suppose to use the Boost unit test framework?
Enforce linking with static library in your command line.
The following program will NOT compile because of the change in 1.34.1 since the 1.33:
/* test_grnn.cpp
#include
using namespace boost::unit_test_framework;
void test_distance_squared () { // do work }
test_suite* init_unit_test_suite ( int, char** ) { test_suite* test = BOOST_TEST_SUITE ("GRNN test suite");
// Allow GRNN to allocate our memory at any location test->add ( BOOST_TEST_CASE ( &test_distance_squared ) );
return test; }
Alternatively you can write above test module as: #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE GRNN test suite BOOST_AUTO_TEST_CASE( test_distance_squared ) { .... } and it will work with shared lib. Remove define BOOST_TEST_DYN_LINK and it will work with static lib as well. Gennadiy