Boost logo

Boost :

From: pankaj takawale (pankajvtakawale_at_[hidden])
Date: 2008-06-02 17:22:50


#include <boost/test/unit_test.hpp>

using namespace boost::unit_test;

void free_test_function()
{
 BOOST_CHECK(2 == 1);
}

test_suite* init_unit_test_suite( int, char* [] )
{
 framework::master_test_suite().p_name.value = "Unit test example 02";
 framework::master_test_suite().add( BOOST_TEST_CASE( &free_test_function ),
2 );
}

Im trying to build above program, but facing linking errors.
Linker can not find main

When I add #define BOOST_TEST_MAIN 1 before including unit-test.cpp, it
gives me compilation
error "redefinition of init_unit_test_suite"

When I define both BOOST_TEST_DYN_LINK & BOOST_TEST_MAIN, then it build
successfully but I get error
"Test setup error: test tree is empty"

Someone please help me solve it.
:wq
Pankaj


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk