그 목적으로 불려질 수있는 문서화되지 않은 * 기능이 있습니다. 다음 줄은 cerr
에 현재 테스트의 이름을 플래시합니다 :
#include <boost/test/framework.hpp>
...
std::cerr << boost::unit_test::framework::current_test_case().p_name
<< std::endl;
참고 그러나이 API를 사용하여 매개 변수화 시험의 경우 매개 변수를 플러시하지 않습니다.
당신은 또한 test checkpoints **에 관심이있을 수있다 (당신이 무엇을 원하는 것 같다.)
#include <boost/test/included/unit_test.hpp>
...
BOOST_AUTO_TEST_CASE(MyTest)
{
BOOST_TEST_CHECKPOINT("Starting");
// lots of code here
BOOST_TEST_CHECKPOINT("Ending");
}
편집
* current_test_case()
기능은 지금 문서화되어, the official Boost documentation 참조 .
** BOOST_TEST_CHECKPOINT
은 이전에 BOOST_CHECKPOINT
이라고 불렀다. Boost changelog (1.35.0)을 참조하십시오.
auto test_name = std::string(boost::unit_test::framework::current_test_case().p_name)
은 [이]를 살펴 보자 (https://groups.google.com/forum/?fromgroups=#!topic : –