Ruediger Berlich wrote:
Hi there,
I am using Boost.Test to run Unit tests for my code (Boost 1.39). For each class, I have a number of tests (implemented through BOOST_AUTO_TEST_CASE or BOOST_AUTO_TEST_CASE_TEMPLATE, respectively), organized in test suites (arranged in BOOST_AUTO_TEST_SUITE blocks). Each BOOST_AUTO_TEST_SUITE with the associated AUTO_TESTs is a separate compilation unit, thus localted in its own file.
An execution order is defined by the test tree structure, which in turn is defined by the order of the registration calls. When using manual registration you can carve you own order. If you employ automatic registration the only thing we can promise is the order of test cases within the same test file. I am not aware about the means to force particular global order of static initializers.
Is there a way to do this with the AUTO-environment, or do I have to resort to manual registration of test suites and/or test cases ?
You can use --run command line parameter to filter out only basic test units in first call and advanced test in second. Boost.Test does support test unit dependency. But: a) It only supported easily for manually registered test units. For automatically registered ones you'll need to jump through some hoops (for example you can define dependency in global fixture) b) Dependency does not actually affect test units order execution. This require potentially complicated reordering of the test tree, which is not implemented yet. Gennadiy