問題は、通常のテストの場合、フィクスチャを testing::Test から派生させる必要があり、パラメータ化されたテストの場合、testing::TestWithParam<> から派生させる必要があることです。
これに対応するには、フィクスチャ クラスを変更してパラメータ タイプを操作する必要があります。
template <class T> class MyFixtureBase : public T {
void SetUp() { ... };
// Put the rest of your original MyFixtureTest here.
};
// This will work with your non-parameterized tests.
class MyFixtureTest : public MyFixtureBase<testing::Test> {};
// This will be the fixture for all your parameterized tests.
// Just substitute the actual type of your parameters for MyParameterType.
class MyParamFixtureTest : public MyFixtureBase<
testing::TestWithParam<MyParameterType> > {};
このようにして、パラメーター化されたテストを作成しながら、既存のすべてのテストをそのまま維持できます。
TEST_P(MyParamFixtureTest, MyTestName) { ... }