Commit 6fce6df7 by Corentin Wallez

Filter out unsupported platforms for value parameterized tests

With this most of the end2end tests pass on Linux BUG=angleproject:997 BUG=angleproject:982 Change-Id: I6aab7d407f260ee24c5c59bf4d6055e875d3a6d6 Reviewed-on: https://chromium-review.googlesource.com/270184Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 12fe4dc8
......@@ -314,8 +314,6 @@ TEST_P(UniformBufferTest, ManyUniformBufferRange)
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
INSTANTIATE_TEST_CASE_P(
ANGLE, UniformBufferTest,
testing::Values(ES3_D3D11(), ES3_D3D11_FL11_1(), ES3_D3D11_FL11_1_REFERENCE()));
ANGLE_INSTANTIATE_TEST(UniformBufferTest, ES3_D3D11(), ES3_D3D11_FL11_1(), ES3_D3D11_FL11_1_REFERENCE());
} // namespace
......@@ -316,8 +316,6 @@ TEST_P(UnpackAlignmentTest, Alignment8AUByte)
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
INSTANTIATE_TEST_CASE_P(
ANGLE, UnpackAlignmentTest,
testing::Values(ES2_D3D9(), ES2_D3D11(), ES2_OPENGL(), ES3_OPENGL()));
ANGLE_INSTANTIATE_TEST(UnpackAlignmentTest, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL(), ES3_OPENGL());
} // namespace
......@@ -120,8 +120,6 @@ TEST_P(UnpackRowLengthTest, RowLength1024)
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
INSTANTIATE_TEST_CASE_P(
ANGLE, UnpackRowLengthTest,
testing::Values(ES3_D3D11(), ES2_D3D11(), ES2_OPENGL(), ES3_OPENGL()));
ANGLE_INSTANTIATE_TEST(UnpackRowLengthTest, ES3_D3D11(), ES2_D3D11(), ES2_OPENGL(), ES3_OPENGL());
} // namespace
......@@ -242,8 +242,6 @@ TEST_P(VertexAttributeTest, ShortNormalized)
// Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against.
// D3D11 Feature Level 9_3 uses different D3D formats for vertex attribs compared to Feature Levels 10_0+, so we should test them separately.
INSTANTIATE_TEST_CASE_P(
ANGLE, VertexAttributeTest,
testing::Values(ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3(), ES2_OPENGL(), ES3_OPENGL()));
ANGLE_INSTANTIATE_TEST(VertexAttributeTest, ES2_D3D9(), ES2_D3D11(), ES2_D3D11_FL9_3(), ES2_OPENGL(), ES3_OPENGL());
} // namespace
......@@ -87,6 +87,42 @@ inline std::ostream &operator<<(std::ostream& stream,
return stream;
}
inline std::vector<PlatformParameters> FilterPlatforms(const PlatformParameters *platforms, size_t numPlatforms)
{
std::vector<PlatformParameters> filtered;
for (size_t i = 0; i < numPlatforms; i++)
{
switch (platforms[i].mEGLPlatformParameters.renderer)
{
case EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE:
#if defined(ANGLE_ENABLE_D3D9)
filtered.push_back(platforms[i]);
#endif
break;
case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE:
#if defined(ANGLE_ENABLE_D3D11)
filtered.push_back(platforms[i]);
#endif
break;
case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:
case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:
#if defined(ANGLE_ENABLE_OPENGL)
filtered.push_back(platforms[i]);
#endif
break;
default:
UNREACHABLE();
break;
}
}
return filtered;
}
inline PlatformParameters ES2_D3D9()
{
EGLPlatformParameters eglParams(
......@@ -400,7 +436,8 @@ inline PlatformParameters ES3_OPENGLES()
}
#define ANGLE_INSTANTIATE_TEST(testName, ...) \
INSTANTIATE_TEST_CASE_P(, testName, testing::Values(__VA_ARGS__));
const PlatformParameters testName##params[] = {__VA_ARGS__}; \
INSTANTIATE_TEST_CASE_P(, testName, testing::ValuesIn(FilterPlatforms(testName##params, ArraySize(testName##params))));
} // namespace angle
......
......@@ -144,4 +144,4 @@ TEST_P(EGLQueryContextTest, BadAttribute)
EXPECT_TRUE(eglGetError() == EGL_BAD_ATTRIBUTE);
}
INSTANTIATE_TEST_CASE_P(ANGLE, EGLQueryContextTest, testing::Values(2, 3));
INSTANTIATE_TEST_CASE_P(, EGLQueryContextTest, testing::Values(2, 3));
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