Commit bae53d96 by Austin Sullivan Committed by Commit Bot

Only define test suites when TEST_Ps defined

The EXTClipCullDistanceForVertexShaderCompileFailureTest and EXTClipCullDistanceForFragmentShaderCompileFailureTest test suites each contain only one test, which is defined iff ANGLE_ENABLE_VULKAN is defined. This results in UNINSTANTIATED_PARAMETERIZED_TEST errors. This problem was discovered by attempting to roll googletest past CL 315255779, which causes test binaries to fail when they include test suites / parametrized tests that are not instantiated, and when they include empty test suites. Bug: chromium:1163396 Change-Id: Ie1837bc2879c14ad9f51a4a757ee1edc7e603c61 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2686377Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent e281fbb0
...@@ -46,6 +46,7 @@ const char VertexShaderCompileSucceeds2[] = ...@@ -46,6 +46,7 @@ const char VertexShaderCompileSucceeds2[] =
gl_CullDistance[gl_MaxCullDistances - int(aPosition.x)] = dot(aPosition, uPlane); gl_CullDistance[gl_MaxCullDistances - int(aPosition.x)] = dot(aPosition, uPlane);
})"; })";
#if defined(ANGLE_ENABLE_VULKAN)
// Shader using gl_ClipDistance and gl_CullDistance // Shader using gl_ClipDistance and gl_CullDistance
// But, the sum of the sizes is greater than gl_MaxCombinedClipAndCullDistances // But, the sum of the sizes is greater than gl_MaxCombinedClipAndCullDistances
const char VertexShaderCompileFails1[] = const char VertexShaderCompileFails1[] =
...@@ -137,6 +138,7 @@ const char VertexShaderCompileFailes6[] = ...@@ -137,6 +138,7 @@ const char VertexShaderCompileFailes6[] =
gl_Position = aPosition; gl_Position = aPosition;
gl_ClipDistance[0] = 0.0; gl_ClipDistance[0] = 0.0;
})"; })";
#endif
// Shader using gl_ClipDistance and gl_CullDistance // Shader using gl_ClipDistance and gl_CullDistance
const char FragmentShaderCompileSucceeds1[] = const char FragmentShaderCompileSucceeds1[] =
...@@ -166,6 +168,7 @@ const char FragmentShaderCompileSucceeds2[] = ...@@ -166,6 +168,7 @@ const char FragmentShaderCompileSucceeds2[] =
fragColor.w = gl_CullDistance[gl_MaxCullDistances - int(aPosition.x)]; fragColor.w = gl_CullDistance[gl_MaxCullDistances - int(aPosition.x)];
})"; })";
#if defined(ANGLE_ENABLE_VULKAN)
// Shader using gl_ClipDistance and gl_CullDistance // Shader using gl_ClipDistance and gl_CullDistance
// But, the sum of the sizes is greater than gl_MaxCombinedClipAndCullDistances // But, the sum of the sizes is greater than gl_MaxCombinedClipAndCullDistances
const char FragmentShaderCompileFails1[] = const char FragmentShaderCompileFails1[] =
...@@ -236,6 +239,7 @@ const char FragmentShaderCompileFails5[] = ...@@ -236,6 +239,7 @@ const char FragmentShaderCompileFails5[] =
} }
fragColor = vec4(color[0], color[1], color[2], 1.0f); fragColor = vec4(color[0], color[1], color[2], 1.0f);
})"; })";
#endif
class EXTClipCullDistanceTest : public sh::ShaderExtensionTest class EXTClipCullDistanceTest : public sh::ShaderExtensionTest
{ {
...@@ -359,7 +363,6 @@ TEST_P(EXTClipCullDistanceForFragmentShaderTest, CompileSucceedsVulkan) ...@@ -359,7 +363,6 @@ TEST_P(EXTClipCullDistanceForFragmentShaderTest, CompileSucceedsVulkan)
EXPECT_FALSE(TestShaderCompile("")); EXPECT_FALSE(TestShaderCompile(""));
EXPECT_TRUE(TestShaderCompile(EXTPragma)); EXPECT_TRUE(TestShaderCompile(EXTPragma));
} }
#endif
class EXTClipCullDistanceForVertexShaderCompileFailureTest class EXTClipCullDistanceForVertexShaderCompileFailureTest
: public EXTClipCullDistanceForVertexShaderTest : public EXTClipCullDistanceForVertexShaderTest
...@@ -369,7 +372,6 @@ class EXTClipCullDistanceForFragmentShaderCompileFailureTest ...@@ -369,7 +372,6 @@ class EXTClipCullDistanceForFragmentShaderCompileFailureTest
: public EXTClipCullDistanceForFragmentShaderTest : public EXTClipCullDistanceForFragmentShaderTest
{}; {};
#if defined(ANGLE_ENABLE_VULKAN)
TEST_P(EXTClipCullDistanceForVertexShaderCompileFailureTest, CompileFails) TEST_P(EXTClipCullDistanceForVertexShaderCompileFailureTest, CompileFails)
{ {
SetExtensionEnable(true); SetExtensionEnable(true);
...@@ -395,12 +397,6 @@ TEST_P(EXTClipCullDistanceForFragmentShaderCompileFailureTest, CompileFails) ...@@ -395,12 +397,6 @@ TEST_P(EXTClipCullDistanceForFragmentShaderCompileFailureTest, CompileFails)
} }
#endif #endif
INSTANTIATE_TEST_SUITE_P(IncorrectESSL100Shaders,
EXTClipCullDistanceForVertexShaderCompileFailureTest,
Combine(Values(SH_GLES2_SPEC),
Values(sh::ESSLVersion100),
Values(VertexShaderCompileFails5, VertexShaderCompileFailes6)));
INSTANTIATE_TEST_SUITE_P(CorrectESSL300Shaders, INSTANTIATE_TEST_SUITE_P(CorrectESSL300Shaders,
EXTClipCullDistanceForVertexShaderTest, EXTClipCullDistanceForVertexShaderTest,
Combine(Values(SH_GLES3_SPEC), Combine(Values(SH_GLES3_SPEC),
...@@ -408,6 +404,22 @@ INSTANTIATE_TEST_SUITE_P(CorrectESSL300Shaders, ...@@ -408,6 +404,22 @@ INSTANTIATE_TEST_SUITE_P(CorrectESSL300Shaders,
Values(VertexShaderCompileSucceeds1, Values(VertexShaderCompileSucceeds1,
VertexShaderCompileSucceeds2))); VertexShaderCompileSucceeds2)));
INSTANTIATE_TEST_SUITE_P(CorrectESSL300Shaders,
EXTClipCullDistanceForFragmentShaderTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(FragmentShaderCompileSucceeds1,
FragmentShaderCompileSucceeds2)));
// The corresponding TEST_Ps are defined only when ANGLE_ENABLE_VULKAN is
// defined.
#if defined(ANGLE_ENABLE_VULKAN)
INSTANTIATE_TEST_SUITE_P(IncorrectESSL100Shaders,
EXTClipCullDistanceForVertexShaderCompileFailureTest,
Combine(Values(SH_GLES2_SPEC),
Values(sh::ESSLVersion100),
Values(VertexShaderCompileFails5, VertexShaderCompileFailes6)));
INSTANTIATE_TEST_SUITE_P(IncorrectESSL300Shaders, INSTANTIATE_TEST_SUITE_P(IncorrectESSL300Shaders,
EXTClipCullDistanceForVertexShaderCompileFailureTest, EXTClipCullDistanceForVertexShaderCompileFailureTest,
Combine(Values(SH_GLES3_SPEC), Combine(Values(SH_GLES3_SPEC),
...@@ -417,13 +429,6 @@ INSTANTIATE_TEST_SUITE_P(IncorrectESSL300Shaders, ...@@ -417,13 +429,6 @@ INSTANTIATE_TEST_SUITE_P(IncorrectESSL300Shaders,
VertexShaderCompileFails3, VertexShaderCompileFails3,
VertexShaderCompileFails4))); VertexShaderCompileFails4)));
INSTANTIATE_TEST_SUITE_P(CorrectESSL300Shaders,
EXTClipCullDistanceForFragmentShaderTest,
Combine(Values(SH_GLES3_SPEC),
Values(sh::ESSLVersion300),
Values(FragmentShaderCompileSucceeds1,
FragmentShaderCompileSucceeds2)));
INSTANTIATE_TEST_SUITE_P(IncorrectESSL300Shaders, INSTANTIATE_TEST_SUITE_P(IncorrectESSL300Shaders,
EXTClipCullDistanceForFragmentShaderCompileFailureTest, EXTClipCullDistanceForFragmentShaderCompileFailureTest,
Combine(Values(SH_GLES3_SPEC), Combine(Values(SH_GLES3_SPEC),
...@@ -433,5 +438,6 @@ INSTANTIATE_TEST_SUITE_P(IncorrectESSL300Shaders, ...@@ -433,5 +438,6 @@ INSTANTIATE_TEST_SUITE_P(IncorrectESSL300Shaders,
FragmentShaderCompileFails3, FragmentShaderCompileFails3,
FragmentShaderCompileFails4, FragmentShaderCompileFails4,
FragmentShaderCompileFails5))); FragmentShaderCompileFails5)));
#endif
} // anonymous namespace } // anonymous namespace
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