boost::test test case levels

Hi there! Our automatic tests are of two kinds: short (just like BOOST_CHECK_EQUAL(2*2, 4);), and complicated, which process bulks of random data (for instance, to check if a map with random numbers is always sorted). So we’d like to select which test cases to run: either simple ones or all. I see two ways: 1. Default variants release, debug build and run only simple test cases. We define another feature (or even a build variant) that builds and runs all the tests. This will require additional build efforts, and we’d like to select test cases in run-time. 2. We try to get use of --run_test=??? and test case name mangling. This is a hack, of course. Is there another way to select test cases in run-time? — Anatoli

Anatoli Sakhnik
2. We try to get use of --run_test=??? and test case name mangling. This is a hack, of course.
Why is it hack exactly? Name you "simple" test case with suffix _simple. Name your "advanced" test case with suffix _adv and use --run_test=*_simple and --run_test=*_adv To filter right subset. You can also place test cases into 2 different test suites and filter by the test suite name
Is there another way to select test cases in run-time?
You can pass your own cla and use manual test units registration. Thus you can register only appropriate type of test units. Gennadiy
participants (2)
-
Anatoli Sakhnik
-
Gennadiy Rozental