我运行这段代码
#define BOOST_TEST_MAIN
#define BOOST_TEST_DYN_LINK
#include <boost/test/unit_test.hpp>
#include <boost/test/unit_test_log.hpp>
#include <boost/filesystem/fstream.hpp>
#include <iostream>
using namespace boost::unit_test;
using namespace std;
void TestFoo()
{
BOOST_CHECK(0==0);
}
test_suite* init_unit_test_suite( int argc, char* argv[] )
{
std::cout << "Enter init_unit_test_suite" << endl;
boost::unit_test::test_suite* master_test_suite =
BOOST_TEST_SUITE( "MasterTestSuite" );
master_test_suite->add(BOOST_TEST_CASE(&TestFoo));
return master_test_suite;
}
但在运行时它说
测试设置错误:测试树为空
为什么它不运行 init_unit_test_suite 函数?