????????boost??test????????????????VC??console??????????′???

#define BOOST_TEST_MODULE test_main
#include <boost/test/unit_test.hpp>
int add( int a?? int b ) {return (a+b);}
BOOST_AUTO_TEST_SUITE(minimal_test)
BOOST_AUTO_TEST_CASE( test_func_add )
{
BOOST_CHECK_EQUAL( 0?? 0 );
BOOST_CHECK_EQUAL( add(1??-1)?? 1 );
getchar();
}
BOOST_AUTO_TEST_SUITE_END()

??????????ε?console?????main?????????$(OutDir)$(ProjectName).exe?????????Post-Build Events?????????????????????

3>Performing Post-Build Event...
3>Running 2 test cases...
3>g:/test/boosttest/maintest/maintest.cpp(45): error in "test_func_add": check add(1??-1) == 1 failed [0 != 1]
3>*** 3 failures detected in test suite "test_main"
3>Project : error PRJ0019: A tool returned an error code from "Performing Post-Build Event..."

???????????????????DLL???????????????????????DLL???????????????exe??Post-Build Events??????boost.test??main???????????????????????????????????????????????????????

????1?????д?????????ó?????dll?е??????????????????????????

//dll?е????????
declspec(dllexport) void myTest()
{  
CMainTest *pTest = new CMainTest();  
if (*pTest>runTest())      
cout<<"??????"<<endl;  
delete *pTest;
}
...
//???????
test_suite* init_unit_test_suite( int?? char* [] )
{  
framework::master_test_suite().p_name.value = "Unit test example 01";   
// register the test case in test tree and specify number of expected failures so  
// this example will pass at runtime. We expect 2 errors: one from failed check and   
// one from memory acces violation  
framework::master_test_suite().add( BOOST_TEST_CASE( &myTest )?? 1 );   
return 0;
}