I am sure this is a silly common answer but I am not sure how to resolve it. Here is my test suite below. I am following http://www.hpfsc.de/boosttest/ as my guide. #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE Statistical algorithm test suite #include <boost/test/unit_test.hpp> #include "Statistical_Test.h" using boost::unit_test_framework::test_suite; using boost::unit_test_framework::test_case; using namespace libreverse::classifier; class statistical_test_suite : public test_suite { public: statistical_test_suite () : test_suite ( "statistical_test_suite" ) { // create an instance of the test cases class boost::shared_ptr<Statistical_Test> instance ( new Statistical_Test() ); test_case* test_Constructor_test_case = BOOST_CLASS_TEST_CASE( &Statistical_Test::test_Constructor, instance ); add ( test_Constructor_test_case ); } }; test_suite* init_unit_test_suite ( int, char** ) { test_suite* top_test_suite = BOOST_TEST_SUITE("Statistical algorithm test suite"); // add test suites to the top test suite top_test_suite->add ( new statistical_test_suite() ); return top_test_suite; }
Stephen Torri <torrisa <at> auburn.edu> writes:
Hi, Sorry guys for my absence for the last couple weeks. I'll try to reply to all questions ASAP.
I am sure this is a silly common answer but I am not sure how to resolve it. Here is my test suite below. I am following http://www.hpfsc.de/boosttest/ as my guide.
I think these instructions might be slightly out of date. The latest documentation is much updated and for now is located at patmedia.net/~rogeeff/html/index.html
#define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE Statistical algorithm test suite
The easiest way to fix this is to comment out two defines above and link with static library. Dynamic library init API is slightly different since 1.34.1 and this is the cause of the error you see. init_unit_test_suite function is not called in this case. In fact would this be the correct function there still exist another problem, but I do not want to confuse any further. Please let me know if this an acceptable fix and if not what is you preferred configuration. Gennadiy
participants (2)
-
Gennadiy Rozental
-
Stephen Torri