中Boost.Test
,如何获取当前自动测试用例的名称?
例子:
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(MyTest)
{
std::cerr << "Starting " << test_name << std::endl;
// lots of code here
std::cerr << "Ending " << test_name << std::endl;
}
在示例中,我希望变量test_name
包含“MyTest”。