
Johan Nilsson wrote:
Ed Johnson wrote:
When using BOOST_AUTO_TEST_SUITE or BOOST_AUTO_TEST_CASE across multiple files, is there a way to guarantee which Test Case or Suite will execute last?
In general you should never write your unit tests to depend on a specific order of execution, but as you're not really writing a test ...
In particular, I want the following test to always be executed last.
BOOST_AUTO_TEST_CASE(waitForUserToPressEnter) { std::cout << "Press <ENTER> to continue..." << std::endl; std::cin.get(); }
I haven't tried this, but what might work is using a global fixture (i.e. BOOST_GLOBAL_FIXTURE) and put the above stuff in its destructor.
// Johan
Thanks, Johan. Unfortunately, Gennadiy let me know that BOOST_GLOBAL_FIXTURE isn't supported in the version of Boost that I am using: 1.33.1