There is an undocumented * function that can be called for this purpose. The following line will clear the name of the current test to cerr :
#include <boost/test/framework.hpp> ... std::cerr << boost::unit_test::framework::current_test_case().p_name << std::endl;
Note, however, that using this API does not reset the parameters in the case of parameterized tests.
You may also be interested in breakpoints (which is similar to what you want to do).
#include <boost/test/included/unit_test.hpp> ... BOOST_AUTO_TEST_CASE(MyTest) { BOOST_TEST_CHECKPOINT("Starting"); // lots of code here BOOST_TEST_CHECKPOINT("Ending"); }
EDIT
* The function current_test_case() documented, see the official Boost documentation .
** BOOST_TEST_CHECKPOINT previously called BOOST_CHECKPOINT . See Boost changelog (1.35.0) .
Raffi
source share