Commit ffd39978 by Victor Costan Committed by Commit Bot

test: Replace _TEST_CASE_ with _TEST_SUITE_.

Googletest is (at last) converging with industry-standard terminology [1]. We previously called test suites "test cases", which was rather confusing for folks coming from any other testing framework. Chrome now has a googletest version that supports _TEST_SUITE_ macros instead of _TEST_CASE_, so this CL cleans up some of the outdated usage. [1] https://github.com/google/googletest/blob/master/googletest/docs/primer.md#beware-of-the-nomenclature Bug: chromium:925652 Change-Id: Ia0deec0bc4216ef1adabc33985a7cbda89682608 Reviewed-on: https://chromium-review.googlesource.com/c/1477418Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Victor Costan <pwnall@chromium.org>
parent 902ceed3
......@@ -161,6 +161,6 @@ TEST_P(VaryingPackingTest, MaxPlusOneMat2VaryingsFailsWebGL)
}
// Makes separate tests for different values of kMaxVaryings.
INSTANTIATE_TEST_CASE_P(, VaryingPackingTest, ::testing::Values(1, 4, 8));
INSTANTIATE_TEST_SUITE_P(, VaryingPackingTest, ::testing::Values(1, 4, 8));
} // anonymous namespace
......@@ -443,7 +443,7 @@ static const scaleValidPair scales[] = {scaleValidPair(1.0f, true), scaleValidPa
scaleValidPair(0.0f, false), scaleValidPair(0.01f, true),
scaleValidPair(2.00f, true)};
INSTANTIATE_TEST_CASE_P(NativeWindowTest, CoreWindowScaleTest, testing::ValuesIn(scales));
INSTANTIATE_TEST_SUITE_P(NativeWindowTest, CoreWindowScaleTest, testing::ValuesIn(scales));
// Tests that the size property works as expected in a property set with a SwapChainPanel
class CoreWindowSizeTest : public testing::TestWithParam<std::tuple<float, float, bool>>
......@@ -492,6 +492,6 @@ typedef std::tuple<float, float, bool> sizeValidPair;
static const sizeValidPair sizes[] = {sizeValidPair(800, 480, true), sizeValidPair(0, 480, false),
sizeValidPair(800, 0, false), sizeValidPair(0, 0, false)};
INSTANTIATE_TEST_CASE_P(NativeWindowTest, CoreWindowSizeTest, testing::ValuesIn(sizes));
INSTANTIATE_TEST_SUITE_P(NativeWindowTest, CoreWindowSizeTest, testing::ValuesIn(sizes));
} // namespace
......@@ -566,7 +566,7 @@ static const scaleValidPair scales[] = {scaleValidPair(1.0f, true), scaleValidPa
scaleValidPair(0.0f, false), scaleValidPair(0.01f, true),
scaleValidPair(2.00f, true)};
INSTANTIATE_TEST_CASE_P(NativeWindowTest, SwapChainPanelScaleTest, testing::ValuesIn(scales));
INSTANTIATE_TEST_SUITE_P(NativeWindowTest, SwapChainPanelScaleTest, testing::ValuesIn(scales));
// Tests that the size property works as expected in a property set with a SwapChainPanel
class SwapChainPanelSizeTest : public testing::TestWithParam<std::tuple<float, float, bool>>
......@@ -615,6 +615,6 @@ typedef std::tuple<float, float, bool> sizeValidPair;
static const sizeValidPair sizes[] = {sizeValidPair(800, 480, true), sizeValidPair(0, 480, false),
sizeValidPair(800, 0, false), sizeValidPair(0, 0, false)};
INSTANTIATE_TEST_CASE_P(NativeWindowTest, SwapChainPanelSizeTest, testing::ValuesIn(sizes));
INSTANTIATE_TEST_SUITE_P(NativeWindowTest, SwapChainPanelSizeTest, testing::ValuesIn(sizes));
} // namespace
......@@ -270,11 +270,11 @@ TEST_P(EXTYUVTargetTest, CompileSucceedsWithExtensionAndPragma)
EXPECT_TRUE(TestShaderCompile(EXTYTPragma));
}
INSTANTIATE_TEST_CASE_P(CorrectVariantsWithExtensionAndPragma,
EXTYUVTargetTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(ESSL300_SimpleShader, ESSL300_FragColorShader)));
INSTANTIATE_TEST_SUITE_P(CorrectVariantsWithExtensionAndPragma,
EXTYUVTargetTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(ESSL300_SimpleShader, ESSL300_FragColorShader)));
class EXTYUVTargetCompileSuccessTest : public EXTYUVTargetTest
{};
......@@ -287,14 +287,14 @@ TEST_P(EXTYUVTargetCompileSuccessTest, CompileSucceeds)
EXPECT_TRUE(TestShaderCompile(EXTYTPragma));
}
INSTANTIATE_TEST_CASE_P(CorrectESSL300Shaders,
EXTYUVTargetCompileSuccessTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(ESSL300_FragColorShader,
ESSL300_YUVQualifierMultipleTimesShader,
ESSL300_YuvCscStandardEXTShader,
ESSL300_BuiltInFunctionsShader)));
INSTANTIATE_TEST_SUITE_P(CorrectESSL300Shaders,
EXTYUVTargetCompileSuccessTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(ESSL300_FragColorShader,
ESSL300_YUVQualifierMultipleTimesShader,
ESSL300_YuvCscStandardEXTShader,
ESSL300_BuiltInFunctionsShader)));
class EXTYUVTargetCompileFailureTest : public EXTYUVTargetTest
{};
......@@ -307,27 +307,27 @@ TEST_P(EXTYUVTargetCompileFailureTest, CompileFails)
EXPECT_FALSE(TestShaderCompile(EXTYTPragma));
}
INSTANTIATE_TEST_CASE_P(IncorrectESSL300Shaders,
EXTYUVTargetCompileFailureTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(ESSL300_YUVQualifierFailureShader1,
ESSL300_YUVQualifierFailureShader2,
ESSL300_LocationAndYUVFailureShader,
ESSL300_MultipleColorAndYUVOutputsFailureShader1,
ESSL300_MultipleColorAndYUVOutputsFailureShader2,
ESSL300_DepthAndYUVOutputsFailureShader,
ESSL300_MultipleYUVOutputsFailureShader,
ESSL300_YuvCscStandartdEXTConstructFailureShader1,
ESSL300_YuvCscStandartdEXTConstructFailureShader2,
ESSL300_YuvCscStandartdEXTConversionFailureShader1,
ESSL300_YuvCscStandartdEXTConversionFailureShader2,
ESSL300_YuvCscStandartdEXTConversionFailureShader3,
ESSL300_YuvCscStandartdEXTConversionFailureShader4,
ESSL300_YuvCscStandartdEXTConversionFailureShader5,
ESSL300_YuvCscStandartdEXTQualifiersFailureShader1,
ESSL300_YuvCscStandartdEXTQualifiersFailureShader2,
ESSL300_YuvCscStandartdEXTQualifiersFailureShader3)));
INSTANTIATE_TEST_SUITE_P(IncorrectESSL300Shaders,
EXTYUVTargetCompileFailureTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(ESSL300_YUVQualifierFailureShader1,
ESSL300_YUVQualifierFailureShader2,
ESSL300_LocationAndYUVFailureShader,
ESSL300_MultipleColorAndYUVOutputsFailureShader1,
ESSL300_MultipleColorAndYUVOutputsFailureShader2,
ESSL300_DepthAndYUVOutputsFailureShader,
ESSL300_MultipleYUVOutputsFailureShader,
ESSL300_YuvCscStandartdEXTConstructFailureShader1,
ESSL300_YuvCscStandartdEXTConstructFailureShader2,
ESSL300_YuvCscStandartdEXTConversionFailureShader1,
ESSL300_YuvCscStandartdEXTConversionFailureShader2,
ESSL300_YuvCscStandartdEXTConversionFailureShader3,
ESSL300_YuvCscStandartdEXTConversionFailureShader4,
ESSL300_YuvCscStandartdEXTConversionFailureShader5,
ESSL300_YuvCscStandartdEXTQualifiersFailureShader1,
ESSL300_YuvCscStandartdEXTQualifiersFailureShader2,
ESSL300_YuvCscStandartdEXTQualifiersFailureShader3)));
class EXTYUVNotEnabledTest : public EXTYUVTargetTest
{};
......@@ -341,10 +341,10 @@ TEST_P(EXTYUVNotEnabledTest, CanOverloadConversions)
EXPECT_TRUE(TestShaderCompile(""));
}
INSTANTIATE_TEST_CASE_P(CoreESSL300Shaders,
EXTYUVNotEnabledTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(ESSL300_OverloadRgb2Yuv, ESSL300_OverloadYuv2Rgb)));
INSTANTIATE_TEST_SUITE_P(CoreESSL300Shaders,
EXTYUVNotEnabledTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(ESSL300_OverloadRgb2Yuv, ESSL300_OverloadYuv2Rgb)));
} // namespace
......@@ -200,22 +200,22 @@ TEST_P(EXTBlendFuncExtendedTest, CompileSucceedsWithExtensionAndPragma)
// The SL #version 100 shaders that are correct work similarly
// in both GL2 and GL3, with and without the version string.
INSTANTIATE_TEST_CASE_P(CorrectESSL100Shaders,
EXTBlendFuncExtendedTest,
Combine(Values(SH_GLES2_SPEC, SH_GLES3_SPEC),
Values("", sh::ESSLVersion100),
Values(ESSL100_SimpleShader1,
ESSL100_MaxDualSourceAccessShader,
ESSL100_FragDataShader)));
INSTANTIATE_TEST_SUITE_P(CorrectESSL100Shaders,
EXTBlendFuncExtendedTest,
Combine(Values(SH_GLES2_SPEC, SH_GLES3_SPEC),
Values("", sh::ESSLVersion100),
Values(ESSL100_SimpleShader1,
ESSL100_MaxDualSourceAccessShader,
ESSL100_FragDataShader)));
INSTANTIATE_TEST_CASE_P(CorrectESSL300Shaders,
EXTBlendFuncExtendedTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(ESSL300_MaxDualSourceAccessShader,
ESSL300_LocationAndUnspecifiedOutputShader,
ESSL300_TwoUnspecifiedLocationOutputsShader,
ESSL300_LocationIndexShader)));
INSTANTIATE_TEST_SUITE_P(CorrectESSL300Shaders,
EXTBlendFuncExtendedTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(ESSL300_MaxDualSourceAccessShader,
ESSL300_LocationAndUnspecifiedOutputShader,
ESSL300_TwoUnspecifiedLocationOutputsShader,
ESSL300_LocationIndexShader)));
class EXTBlendFuncExtendedCompileFailureTest : public EXTBlendFuncExtendedTest
{};
......@@ -230,39 +230,39 @@ TEST_P(EXTBlendFuncExtendedCompileFailureTest, CompileFails)
}
// Incorrect #version 100 shaders fail.
INSTANTIATE_TEST_CASE_P(IncorrectESSL100Shaders,
EXTBlendFuncExtendedCompileFailureTest,
Combine(Values(SH_GLES2_SPEC),
Values(sh::ESSLVersion100),
Values(ESSL100_ColorAndDataWriteFailureShader1,
ESSL100_ColorAndDataWriteFailureShader2,
ESSL100_ColorAndDataWriteFailureShader3)));
INSTANTIATE_TEST_SUITE_P(IncorrectESSL100Shaders,
EXTBlendFuncExtendedCompileFailureTest,
Combine(Values(SH_GLES2_SPEC),
Values(sh::ESSLVersion100),
Values(ESSL100_ColorAndDataWriteFailureShader1,
ESSL100_ColorAndDataWriteFailureShader2,
ESSL100_ColorAndDataWriteFailureShader3)));
// Correct #version 300 es shaders fail in GLES2 context, regardless of version string.
INSTANTIATE_TEST_CASE_P(CorrectESSL300Shaders,
EXTBlendFuncExtendedCompileFailureTest,
Combine(Values(SH_GLES2_SPEC),
Values("", sh::ESSLVersion100, sh::ESSLVersion300),
Values(ESSL300_LocationAndUnspecifiedOutputShader,
ESSL300_TwoUnspecifiedLocationOutputsShader)));
INSTANTIATE_TEST_SUITE_P(CorrectESSL300Shaders,
EXTBlendFuncExtendedCompileFailureTest,
Combine(Values(SH_GLES2_SPEC),
Values("", sh::ESSLVersion100, sh::ESSLVersion300),
Values(ESSL300_LocationAndUnspecifiedOutputShader,
ESSL300_TwoUnspecifiedLocationOutputsShader)));
// Correct #version 100 shaders fail when used with #version 300 es.
INSTANTIATE_TEST_CASE_P(CorrectESSL100Shaders,
EXTBlendFuncExtendedCompileFailureTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(ESSL100_SimpleShader1, ESSL100_FragDataShader)));
INSTANTIATE_TEST_SUITE_P(CorrectESSL100Shaders,
EXTBlendFuncExtendedCompileFailureTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(ESSL100_SimpleShader1, ESSL100_FragDataShader)));
// Incorrect #version 300 es shaders always fail.
INSTANTIATE_TEST_CASE_P(IncorrectESSL300Shaders,
EXTBlendFuncExtendedCompileFailureTest,
Combine(Values(SH_GLES3_1_SPEC),
Values(sh::ESSLVersion300, sh::ESSLVersion310),
Values(ESSL300_LocationIndexFailureShader,
ESSL300_DoubleIndexFailureShader,
ESSL300_GlobalIndexFailureShader,
ESSL300_IndexOnUniformVariableFailureShader,
ESSL300_IndexOnStructFailureShader,
ESSL300_IndexOnStructFieldFailureShader)));
INSTANTIATE_TEST_SUITE_P(IncorrectESSL300Shaders,
EXTBlendFuncExtendedCompileFailureTest,
Combine(Values(SH_GLES3_1_SPEC),
Values(sh::ESSLVersion300, sh::ESSLVersion310),
Values(ESSL300_LocationIndexFailureShader,
ESSL300_DoubleIndexFailureShader,
ESSL300_GlobalIndexFailureShader,
ESSL300_IndexOnUniformVariableFailureShader,
ESSL300_IndexOnStructFailureShader,
ESSL300_IndexOnStructFieldFailureShader)));
} // namespace
......@@ -58,10 +58,10 @@ TEST_P(EXTFragDepthTest, CompileSucceedsWithExtensionAndPragma)
// The SL #version 100 shaders that are correct work similarly
// in both GL2 and GL3, with and without the version string.
INSTANTIATE_TEST_CASE_P(CorrectESSL100Shaders,
EXTFragDepthTest,
Combine(Values(SH_GLES2_SPEC),
Values(sh::ESSLVersion100),
Values(ESSL100_FragDepthShader)));
INSTANTIATE_TEST_SUITE_P(CorrectESSL100Shaders,
EXTFragDepthTest,
Combine(Values(SH_GLES2_SPEC),
Values(sh::ESSLVersion100),
Values(ESSL100_FragDepthShader)));
} // anonymous namespace
......@@ -59,10 +59,10 @@ TEST_P(EXTShaderTextureLodTest, CompileSucceedsWithExtensionAndPragma)
// The SL #version 100 shaders that are correct work similarly
// in both GL2 and GL3, with and without the version string.
INSTANTIATE_TEST_CASE_P(CorrectESSL100Shaders,
EXTShaderTextureLodTest,
Combine(Values(SH_GLES2_SPEC),
Values(sh::ESSLVersion100),
Values(ESSL100_TextureLodShader)));
INSTANTIATE_TEST_SUITE_P(CorrectESSL100Shaders,
EXTShaderTextureLodTest,
Combine(Values(SH_GLES2_SPEC),
Values(sh::ESSLVersion100),
Values(ESSL100_TextureLodShader)));
} // anonymous namespace
......@@ -63,7 +63,7 @@ class FloatLexTest : public ::testing::Test
};
typedef ::testing::Types<StrtofClampParser, NumericLexFloatParser> FloatParserTypes;
TYPED_TEST_CASE(FloatLexTest, FloatParserTypes);
TYPED_TEST_SUITE(FloatLexTest, FloatParserTypes);
TYPED_TEST(FloatLexTest, One)
{
......
......@@ -116,4 +116,4 @@ TEST_P(FragDepthTest, ExtensionFDFailsESSL300)
}
// The tests should pass regardless whether the EXT_frag_depth is on or not.
INSTANTIATE_TEST_CASE_P(FragDepthTests, FragDepthTest, testing::Values(false, true));
INSTANTIATE_TEST_SUITE_P(FragDepthTests, FragDepthTest, testing::Values(false, true));
......@@ -80,7 +80,7 @@ TEST_P(OESStandardDerivativesTest, CompileSucceedsWithExtensionAndPragma)
// The SL #version 100 shaders that are correct work similarly
// in both GL2 and GL3, with and without the version string.
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
CorrectESSL100Shaders,
OESStandardDerivativesTest,
Combine(Values(SH_GLES2_SPEC),
......
......@@ -453,15 +453,15 @@ void dEQPTest<TestModuleIndex>::TearDownTestCase()
deqp_libtester_shutdown_platform();
}
#define ANGLE_INSTANTIATE_DEQP_TEST_CASE(API, N) \
class dEQP : public dEQPTest<N> \
{}; \
TEST_P(dEQP, API) { runTest(); } \
\
INSTANTIATE_TEST_CASE_P(, dEQP, dEQP::GetTestingRange(), \
[](const testing::TestParamInfo<size_t> &info) { \
return dEQP::GetCaseGTestName(info.param); \
})
#define ANGLE_INSTANTIATE_DEQP_TEST_CASE(API, N) \
class dEQP : public dEQPTest<N> \
{}; \
TEST_P(dEQP, API) { runTest(); } \
\
INSTANTIATE_TEST_SUITE_P(, dEQP, dEQP::GetTestingRange(), \
[](const testing::TestParamInfo<size_t> &info) { \
return dEQP::GetCaseGTestName(info.param); \
})
#ifdef ANGLE_DEQP_GLES2_TESTS
ANGLE_INSTANTIATE_DEQP_TEST_CASE(GLES2, 0);
......
......@@ -512,7 +512,7 @@ const angle::PlatformParameters es2_platforms[] = {
ES2_VULKAN(),
};
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
,
MultiDrawTest,
testing::Combine(testing::ValuesIn(::angle::FilterTestParams(platforms, ArraySize(platforms))),
......@@ -521,7 +521,7 @@ INSTANTIATE_TEST_CASE_P(
InstancingOption::UseInstancing)),
PrintToStringParamName());
INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_SUITE_P(
,
MultiDrawNoInstancingSupportTest,
testing::Combine(testing::ValuesIn(::angle::FilterTestParams(es2_platforms,
......
......@@ -39,7 +39,7 @@ typedef testing::Types<D3D11> ConformanceTestTypes;
template <typename T> \
class name : public ConformanceTest<T> \
{}; \
TYPED_TEST_CASE(name, ConformanceTestTypes);
TYPED_TEST_SUITE(name, ConformanceTestTypes);
template <typename T>
class ConformanceTest : public testing::Test
......
......@@ -52,7 +52,7 @@ using TestTypes = Types<angle::IterableBitSet<32>, angle::BitSet32<32>, angle::B
#else
using TestTypes = Types<angle::IterableBitSet<32>, angle::BitSet32<32>>;
#endif // defined(ANGLE_IS_64_BIT_CPU)
TYPED_TEST_CASE(BitSetIteratorPerfTest, TestTypes);
TYPED_TEST_SUITE(BitSetIteratorPerfTest, TestTypes);
TYPED_TEST(BitSetIteratorPerfTest, Run)
{
......
......@@ -610,14 +610,14 @@ TEST_P(VulkanCommandBufferPerfTest, Run)
run();
}
INSTANTIATE_TEST_CASE_P(,
VulkanCommandBufferPerfTest,
::testing::Values(PrimaryCBHundredIndividualParams(),
PrimaryCBOneWithOneHundredParams(),
SecondaryCBParams(),
CommandPoolDestroyParams(),
CommandPoolHardResetParams(),
CommandPoolSoftResetParams(),
CommandBufferExplicitHardResetParams(),
CommandBufferExplicitSoftResetParams(),
CommandBufferImplicitResetParams()));
INSTANTIATE_TEST_SUITE_P(,
VulkanCommandBufferPerfTest,
::testing::Values(PrimaryCBHundredIndividualParams(),
PrimaryCBOneWithOneHundredParams(),
SecondaryCBParams(),
CommandPoolDestroyParams(),
CommandPoolHardResetParams(),
CommandPoolSoftResetParams(),
CommandBufferExplicitHardResetParams(),
CommandBufferExplicitSoftResetParams(),
CommandBufferImplicitResetParams()));
......@@ -92,6 +92,6 @@ TEST_P(CharTest, Identified)
// Note +1 for the max-value in range. It is there because the max-value
// not included in the range.
INSTANTIATE_TEST_CASE_P(All, CharTest, testing::Range(CHAR_MIN, CHAR_MAX + 1));
INSTANTIATE_TEST_SUITE_P(All, CharTest, testing::Range(CHAR_MIN, CHAR_MAX + 1));
} // namespace angle
......@@ -22,22 +22,22 @@ TEST_P(CommentTest, CommentIgnored)
EXPECT_EQ(pp::Token::LAST, token.type);
}
INSTANTIATE_TEST_CASE_P(LineComment,
CommentTest,
testing::Values("//foo\n", // With newline.
"//foo", // Without newline.
"//**/", // Nested block comment.
"////", // Nested line comment.
"//\"")); // Invalid character.
INSTANTIATE_TEST_SUITE_P(LineComment,
CommentTest,
testing::Values("//foo\n", // With newline.
"//foo", // Without newline.
"//**/", // Nested block comment.
"////", // Nested line comment.
"//\"")); // Invalid character.
INSTANTIATE_TEST_CASE_P(BlockComment,
CommentTest,
testing::Values("/*foo*/",
"/*foo\n*/", // With newline.
"/*//*/", // Nested line comment.
"/*/**/", // Nested block comment.
"/***/", // With lone '*'.
"/*\"*/")); // Invalid character.
INSTANTIATE_TEST_SUITE_P(BlockComment,
CommentTest,
testing::Values("/*foo*/",
"/*foo\n*/", // With newline.
"/*//*/", // Nested line comment.
"/*/**/", // Nested block comment.
"/***/", // With lone '*'.
"/*\"*/")); // Invalid character.
class BlockCommentTest : public SimplePreprocessorTest
{};
......
......@@ -130,6 +130,6 @@ static const ExtensionTestParam kParams[] = {
{"#extension foo : \n", pp::Diagnostics::PP_INVALID_EXTENSION_DIRECTIVE},
{"#extension foo : 1\n", pp::Diagnostics::PP_INVALID_EXTENSION_BEHAVIOR},
{"#extension foo : bar baz\n", pp::Diagnostics::PP_UNEXPECTED_TOKEN}};
INSTANTIATE_TEST_CASE_P(All, InvalidExtensionTest, testing::ValuesIn(kParams));
INSTANTIATE_TEST_SUITE_P(All, InvalidExtensionTest, testing::ValuesIn(kParams));
} // namespace angle
......@@ -39,13 +39,13 @@ TEST_P(SingleLetterIdentifierTest, Identified)
}
// Test string: '_'
INSTANTIATE_TEST_CASE_P(Underscore, SingleLetterIdentifierTest, testing::Values('_'));
INSTANTIATE_TEST_SUITE_P(Underscore, SingleLetterIdentifierTest, testing::Values('_'));
// Test string: [a-z]
INSTANTIATE_TEST_CASE_P(a_z, SingleLetterIdentifierTest, CLOSED_RANGE('a', 'z'));
INSTANTIATE_TEST_SUITE_P(a_z, SingleLetterIdentifierTest, CLOSED_RANGE('a', 'z'));
// Test string: [A-Z]
INSTANTIATE_TEST_CASE_P(A_Z, SingleLetterIdentifierTest, CLOSED_RANGE('A', 'Z'));
INSTANTIATE_TEST_SUITE_P(A_Z, SingleLetterIdentifierTest, CLOSED_RANGE('A', 'Z'));
typedef std::tuple<char, char> IdentifierParams;
class DoubleLetterIdentifierTest : public IdentifierTest,
......@@ -63,64 +63,64 @@ TEST_P(DoubleLetterIdentifierTest, Identified)
}
// Test string: "__"
INSTANTIATE_TEST_CASE_P(Underscore_Underscore,
DoubleLetterIdentifierTest,
testing::Combine(testing::Values('_'), testing::Values('_')));
INSTANTIATE_TEST_SUITE_P(Underscore_Underscore,
DoubleLetterIdentifierTest,
testing::Combine(testing::Values('_'), testing::Values('_')));
// Test string: "_"[a-z]
INSTANTIATE_TEST_CASE_P(Underscore_a_z,
DoubleLetterIdentifierTest,
testing::Combine(testing::Values('_'), CLOSED_RANGE('a', 'z')));
INSTANTIATE_TEST_SUITE_P(Underscore_a_z,
DoubleLetterIdentifierTest,
testing::Combine(testing::Values('_'), CLOSED_RANGE('a', 'z')));
// Test string: "_"[A-Z]
INSTANTIATE_TEST_CASE_P(Underscore_A_Z,
DoubleLetterIdentifierTest,
testing::Combine(testing::Values('_'), CLOSED_RANGE('A', 'Z')));
INSTANTIATE_TEST_SUITE_P(Underscore_A_Z,
DoubleLetterIdentifierTest,
testing::Combine(testing::Values('_'), CLOSED_RANGE('A', 'Z')));
// Test string: "_"[0-9]
INSTANTIATE_TEST_CASE_P(Underscore_0_9,
DoubleLetterIdentifierTest,
testing::Combine(testing::Values('_'), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_SUITE_P(Underscore_0_9,
DoubleLetterIdentifierTest,
testing::Combine(testing::Values('_'), CLOSED_RANGE('0', '9')));
// Test string: [a-z]"_"
INSTANTIATE_TEST_CASE_P(a_z_Underscore,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('a', 'z'), testing::Values('_')));
INSTANTIATE_TEST_SUITE_P(a_z_Underscore,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('a', 'z'), testing::Values('_')));
// Test string: [a-z][a-z]
INSTANTIATE_TEST_CASE_P(a_z_a_z,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('a', 'z'), CLOSED_RANGE('a', 'z')));
INSTANTIATE_TEST_SUITE_P(a_z_a_z,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('a', 'z'), CLOSED_RANGE('a', 'z')));
// Test string: [a-z][A-Z]
INSTANTIATE_TEST_CASE_P(a_z_A_Z,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('a', 'z'), CLOSED_RANGE('A', 'Z')));
INSTANTIATE_TEST_SUITE_P(a_z_A_Z,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('a', 'z'), CLOSED_RANGE('A', 'Z')));
// Test string: [a-z][0-9]
INSTANTIATE_TEST_CASE_P(a_z_0_9,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('a', 'z'), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_SUITE_P(a_z_0_9,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('a', 'z'), CLOSED_RANGE('0', '9')));
// Test string: [A-Z]"_"
INSTANTIATE_TEST_CASE_P(A_Z_Underscore,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('A', 'Z'), testing::Values('_')));
INSTANTIATE_TEST_SUITE_P(A_Z_Underscore,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('A', 'Z'), testing::Values('_')));
// Test string: [A-Z][a-z]
INSTANTIATE_TEST_CASE_P(A_Z_a_z,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('A', 'Z'), CLOSED_RANGE('a', 'z')));
INSTANTIATE_TEST_SUITE_P(A_Z_a_z,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('A', 'Z'), CLOSED_RANGE('a', 'z')));
// Test string: [A-Z][A-Z]
INSTANTIATE_TEST_CASE_P(A_Z_A_Z,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('A', 'Z'), CLOSED_RANGE('A', 'Z')));
INSTANTIATE_TEST_SUITE_P(A_Z_A_Z,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('A', 'Z'), CLOSED_RANGE('A', 'Z')));
// Test string: [A-Z][0-9]
INSTANTIATE_TEST_CASE_P(A_Z_0_9,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('A', 'Z'), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_SUITE_P(A_Z_0_9,
DoubleLetterIdentifierTest,
testing::Combine(CLOSED_RANGE('A', 'Z'), CLOSED_RANGE('0', '9')));
// The tests above cover one-letter and various combinations of two-letter
// identifier names. This test covers all characters in a single string.
......
......@@ -370,7 +370,7 @@ static const LineTestParam kParams[] = {
{"#line 0xffffffff\n", pp::Diagnostics::PP_INTEGER_OVERFLOW},
{"#line 10 0xffffffff\n", pp::Diagnostics::PP_INTEGER_OVERFLOW}};
INSTANTIATE_TEST_CASE_P(All, InvalidLineTest, testing::ValuesIn(kParams));
INSTANTIATE_TEST_SUITE_P(All, InvalidLineTest, testing::ValuesIn(kParams));
struct LineExpressionTestParam
{
......@@ -399,6 +399,6 @@ static const LineExpressionTestParam kParamsLineExpressionTest[] = {
{"+9", 9}, {"(1 + 2) * 4", 12}, {"3 | 5", 7}, {"3 ^ 5", 6}, {"3 & 5", 1},
{"~5", ~5}, {"2 << 3", 16}, {"16 >> 2", 4}};
INSTANTIATE_TEST_CASE_P(All, LineExpressionTest, testing::ValuesIn(kParamsLineExpressionTest));
INSTANTIATE_TEST_SUITE_P(All, LineExpressionTest, testing::ValuesIn(kParamsLineExpressionTest));
} // namespace angle
......@@ -28,11 +28,11 @@ TEST_P(InvalidNumberTest, InvalidNumberIdentified)
preprocess(str);
}
INSTANTIATE_TEST_CASE_P(InvalidIntegers, InvalidNumberTest, testing::Values("1a", "08", "0xG"));
INSTANTIATE_TEST_SUITE_P(InvalidIntegers, InvalidNumberTest, testing::Values("1a", "08", "0xG"));
INSTANTIATE_TEST_CASE_P(InvalidFloats,
InvalidNumberTest,
testing::Values("1eg", "0.a", "0.1.2", ".0a", ".0.1"));
INSTANTIATE_TEST_SUITE_P(InvalidFloats,
InvalidNumberTest,
testing::Values("1eg", "0.a", "0.1.2", ".0a", ".0.1"));
typedef std::tuple<const char *, char> IntegerParams;
class IntegerTest : public SimplePreprocessorTest, public testing::WithParamInterface<IntegerParams>
......@@ -50,25 +50,25 @@ TEST_P(IntegerTest, Identified)
EXPECT_EQ(str, token.text);
}
INSTANTIATE_TEST_CASE_P(DecimalInteger,
IntegerTest,
testing::Combine(testing::Values(""), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_SUITE_P(DecimalInteger,
IntegerTest,
testing::Combine(testing::Values(""), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_CASE_P(OctalInteger,
IntegerTest,
testing::Combine(testing::Values("0"), CLOSED_RANGE('0', '7')));
INSTANTIATE_TEST_SUITE_P(OctalInteger,
IntegerTest,
testing::Combine(testing::Values("0"), CLOSED_RANGE('0', '7')));
INSTANTIATE_TEST_CASE_P(HexadecimalInteger_0_9,
IntegerTest,
testing::Combine(testing::Values("0x", "0X"), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_SUITE_P(HexadecimalInteger_0_9,
IntegerTest,
testing::Combine(testing::Values("0x", "0X"), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_CASE_P(HexadecimalInteger_a_f,
IntegerTest,
testing::Combine(testing::Values("0x", "0X"), CLOSED_RANGE('a', 'f')));
INSTANTIATE_TEST_SUITE_P(HexadecimalInteger_a_f,
IntegerTest,
testing::Combine(testing::Values("0x", "0X"), CLOSED_RANGE('a', 'f')));
INSTANTIATE_TEST_CASE_P(HexadecimalInteger_A_F,
IntegerTest,
testing::Combine(testing::Values("0x", "0X"), CLOSED_RANGE('A', 'F')));
INSTANTIATE_TEST_SUITE_P(HexadecimalInteger_A_F,
IntegerTest,
testing::Combine(testing::Values("0x", "0X"), CLOSED_RANGE('A', 'F')));
class FloatTest : public SimplePreprocessorTest
{
......@@ -102,12 +102,12 @@ TEST_P(FloatScientificTest, FloatIdentified)
expectFloat(str);
}
INSTANTIATE_TEST_CASE_P(FloatScientific,
FloatScientificTest,
testing::Combine(CLOSED_RANGE('0', '9'),
testing::Values('e', 'E'),
testing::Values("", "+", "-"),
CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_SUITE_P(FloatScientific,
FloatScientificTest,
testing::Combine(CLOSED_RANGE('0', '9'),
testing::Values('e', 'E'),
testing::Values("", "+", "-"),
CLOSED_RANGE('0', '9')));
typedef std::tuple<char, char> FloatFractionParams;
class FloatFractionTest : public FloatTest, public testing::WithParamInterface<FloatFractionParams>
......@@ -132,17 +132,17 @@ TEST_P(FloatFractionTest, FloatIdentified)
expectFloat(str);
}
INSTANTIATE_TEST_CASE_P(FloatFraction_X_X,
FloatFractionTest,
testing::Combine(CLOSED_RANGE('0', '9'), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_SUITE_P(FloatFraction_X_X,
FloatFractionTest,
testing::Combine(CLOSED_RANGE('0', '9'), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_CASE_P(FloatFraction_0_X,
FloatFractionTest,
testing::Combine(testing::Values('\0'), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_SUITE_P(FloatFraction_0_X,
FloatFractionTest,
testing::Combine(testing::Values('\0'), CLOSED_RANGE('0', '9')));
INSTANTIATE_TEST_CASE_P(FloatFraction_X_0,
FloatFractionTest,
testing::Combine(CLOSED_RANGE('0', '9'), testing::Values('\0')));
INSTANTIATE_TEST_SUITE_P(FloatFraction_X_0,
FloatFractionTest,
testing::Combine(CLOSED_RANGE('0', '9'), testing::Values('\0')));
// In the tests above we have tested individual parts of a float separately.
// This test has all parts of a float.
......
......@@ -73,6 +73,6 @@ static const OperatorTestParam kOperators[] = {{"(", '('},
{"^=", pp::Token::OP_XOR_ASSIGN},
{"|=", pp::Token::OP_OR_ASSIGN}};
INSTANTIATE_TEST_CASE_P(All, OperatorTest, testing::ValuesIn(kOperators));
INSTANTIATE_TEST_SUITE_P(All, OperatorTest, testing::ValuesIn(kOperators));
} // namespace angle
......@@ -140,13 +140,13 @@ TEST_P(InvalidPragmaTest, Identified)
preprocess(str, expected);
}
INSTANTIATE_TEST_CASE_P(All,
InvalidPragmaTest,
testing::Values("#pragma 1\n", // Invalid name.
"#pragma foo()\n", // Missing value.
"#pragma foo bar)\n", // Missing left paren,
"#pragma foo(bar\n", // Missing right paren.
"#pragma foo bar\n", // Missing parens.
"#pragma foo(bar) baz\n")); // Extra tokens.
INSTANTIATE_TEST_SUITE_P(All,
InvalidPragmaTest,
testing::Values("#pragma 1\n", // Invalid name.
"#pragma foo()\n", // Missing value.
"#pragma foo bar)\n", // Missing left paren,
"#pragma foo(bar\n", // Missing right paren.
"#pragma foo bar\n", // Missing parens.
"#pragma foo(bar) baz\n")); // Extra tokens.
} // namespace angle
......@@ -51,7 +51,7 @@ TEST_P(SpaceCharTest, SpaceIgnored)
expectSpace(str);
}
INSTANTIATE_TEST_CASE_P(SingleSpaceChar, SpaceCharTest, testing::ValuesIn(kSpaceChars));
INSTANTIATE_TEST_SUITE_P(SingleSpaceChar, SpaceCharTest, testing::ValuesIn(kSpaceChars));
// This test fixture tests the processing of a string containing consecutive
// whitespace characters. All tests in this fixture are ran with all possible
......@@ -72,11 +72,11 @@ TEST_P(SpaceStringTest, SpaceIgnored)
expectSpace(str);
}
INSTANTIATE_TEST_CASE_P(SpaceCharCombination,
SpaceStringTest,
testing::Combine(testing::ValuesIn(kSpaceChars),
testing::ValuesIn(kSpaceChars),
testing::ValuesIn(kSpaceChars)));
INSTANTIATE_TEST_SUITE_P(SpaceCharCombination,
SpaceStringTest,
testing::Combine(testing::ValuesIn(kSpaceChars),
testing::ValuesIn(kSpaceChars),
testing::ValuesIn(kSpaceChars)));
// The tests above make sure that the space char is recorded in the
// next token. This test makes sure that a token is not incorrectly marked
......
......@@ -196,6 +196,6 @@ static const VersionTestParam kParams[] = {
{"#version 100 foo\n", pp::Diagnostics::PP_UNEXPECTED_TOKEN},
{"#version 0xffffffff\n", pp::Diagnostics::PP_INTEGER_OVERFLOW}};
INSTANTIATE_TEST_CASE_P(All, InvalidVersionTest, testing::ValuesIn(kParams));
INSTANTIATE_TEST_SUITE_P(All, InvalidVersionTest, testing::ValuesIn(kParams));
} // namespace angle
......@@ -53,12 +53,12 @@ std::vector<T> FilterTestParams(const std::vector<T> &params)
// Instantiate the test once for each extra argument. The types of all the
// arguments must match, and getRenderer must be implemented for that type.
#define ANGLE_INSTANTIATE_TEST(testName, firstParam, ...) \
const decltype(firstParam) testName##params[] = {firstParam, ##__VA_ARGS__}; \
INSTANTIATE_TEST_CASE_P(, testName, \
testing::ValuesIn(::angle::FilterTestParams( \
testName##params, ArraySize(testName##params))), \
testing::PrintToStringParamName())
#define ANGLE_INSTANTIATE_TEST(testName, firstParam, ...) \
const decltype(firstParam) testName##params[] = {firstParam, ##__VA_ARGS__}; \
INSTANTIATE_TEST_SUITE_P(, testName, \
testing::ValuesIn(::angle::FilterTestParams( \
testName##params, ArraySize(testName##params))), \
testing::PrintToStringParamName())
// Checks if a config is expected to be supported by checking a system-based white list.
bool IsConfigWhitelisted(const SystemInfo &systemInfo, const PlatformParameters &param);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment