在Boost.Test
中,我如何获取当前自动测试用例的名称?在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的”。
看看[这里](https://groups.google.com/forum/?fromgroups=#!topic/boost-list/ZzFmu14UfeQ),到目前为止它适用于我 –