Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
BOOST_TEST_CHECKPOINT

BOOST_TEST_CHECKPOINT(message) registers a test case checkpoint and associated message with the test runner. A checkpoint includes the source file and line number where the macro was invoked. If the test case is aborted unexpectedly, the source location and message associated with the last registered checkpoint is emitted into the log. Checkpoints can be used to identify the location of an unexpected failure within a block of test case code. The message is applied to an output stream with operator<< and can include other invocations of operator<<.

BOOST_AUTO_TEST_CASE(example_checkpoint)
{
    int const i = 0;
    BOOST_TEST_CHECKPOINT("i = " << i);

    BOOST_REQUIRE(i == 0);
}


PrevUpHomeNext