これは、継承を使用して 2 番目のテスト クラスを作成することで実行できるはずです。
これは、次の 2 つの FAQ エントリのアプローチに似ています。
テスト フィクスチャを別のフィクスチャから派生させることはできますか?
同じロジックを共有するいくつかのテストケースがあります...
以下のコード アウトラインでは、型を 2つのばらばらのセットに分けています。
template <typename T>
class FooTest : public testing::Test
{
//class body
};
// TestTypes only contains some of the types as before
// in this example, floating point types are tested only with FooTest.
typedef ::testing::Types<float, double, /*, and few more*/> TestTypes;
TYPED_TEST_CASE(FooTest, TestTypes);
TYPED_TEST(FooTest, test1)
{
//...
}
// Optional, but could allow you to reuse test constructor
// and SetUp/TearDown functions
template <typename T>
class ExtendedFooTest : public FooTest<T>
{}
// And integral types are given extended tests
typedef ::testing::Types<int, unsigned int, and few more*/> ExtendedFooTypes;
TYPED_TEST_CASE(FooTest, ExtendedFooTypes); // repeat the tests above
TYPED_TEST_CASE(ExtendedFooTest, ExtendedFooTypes); // Plus add new tests.
TYPED_TEST(ExtendedFooTest, test2)
{
//...;
}