Hello there !
I know that fixture can be derived. I already have fixtures like those :
class HeavyTestCase : public ::testing::Test
{
protected:
static void SetUpTestCase() { /* Do HEAVY initialisation */ }
static void TearDownTestCase() { /* Do HEAVY cleanup */ }
class BasicFixture1 : public HeavyTestCase
{
public:
virtual void SetUp() { /* Small per test set up */ }
virtual void TearDown() { /* Small per test cleanup */ }
} ;
class BasicFixture2 : public HeavyTestCase
{
public:
virtual void SetUp() { /* Small per test set up */ }
virtual void TearDown() { /* Small per test cleanup */ }
} ;
TEST_F( BasicFixture1, test1_1 )
{
// Do tests
}
TEST_F( BasicFixture1, test1_2 )
{
// Do tests
}
TEST_F( BasicFixture2, test2_1 )
{
// Do tests
}
What I would need is that HeavyTestCase's static SetUptestCase/TearDownTestCase is only called once because BasicFixture1 and BasicFixture2 shares the same parent.
In other words, test "architecture" should be :
HeavyTestCase
BasicFixture1
test1_1
test1_2
BasicFixture2
test2_1
Actually, a workaround could also do it bit I would really appreciate being able to call a test :
HeavyTestCase.BasicFixture1.test1_1
Thank you