
AMDG Hicham Mouline wrote:
Hicham Mouline
writes: I have auto test cases that can take fixtures whose members they
access in a
uniform way.
Say struct F1... Fn
BOOST_FIXTURE_TEST_CASE( test_case1 , F1 ... Fn ) { //same code for all Fi }
Is there a way to do this?
Regards,
1. Make Fi inherit from Fi+1. 2. Use something like this:
template
struct FixtureCollector : T1, T2 {}; You can now either implement above using variardic templates or implement macro that will convert PP sequence into sequence of FixtureCollector
: For example
FIXTURES((T1)(T2)(T3)) should generate:
FixtureCollector
> use it :
BOOST_FIXTURE_TEST_CASE( test_case1 , FIXTURES((T1)(T2)(T3)) ) { }
The question is how to run the test case on T1 then on T2 then .... on Tn , on each one separately
In other words, you'd like there to be a BOOST_FIXTURE_TEST_CASE_TEMPLATE to complement BOOST_AUTO_TEST_CASE_TEMPLATE In Christ, Steven Watanabe