Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards


Function current_auto_test_suite

boost::unit_test::framework::current_auto_test_suite — Provides both read and write access to current "leaf" auto test suite during the test unit registration phase.


// In header: <boost/test/framework.hpp>

test_suite & 
current_auto_test_suite(test_suite * ts = 0, bool push_or_pop = true);


During auto-registration phase the framework maintain a FIFO queue of test units being registered. New test units become children of the current "leaf" test suite and if this is test suite it is pushed back into queue and becomes a new leaf. When test suite registration is completed, a test suite is popped from the back of the queue. Only automatically registered test suites should be added to this queue. Master test suite is always a zero element in this queue, so if no other test suites are registered all test cases are added to master test suite. This function facilitates all three possible actions:

  • if no argument are provided it returns the current queue leaf test suite

  • if test suite is provided and no second argument are set, test suite is added to the queue

  • if no test suite are provided and last argument is false, the semantic of this function is similar to queue pop: last element is popped from the queue



should we push ts to the queue or pop leaf test suite instead


test suite to push back to the queue