Code refactoring for end2end tests.
This change:
1) uses the new style ANGLE_SKIP_TEST_IF to skip tests.
2) replaces compile-time definition for OSX to skip tests by run-time
function IsOSX() to skip tests, in order to align with ANGLE_SKIP_TEST_IF.
3) fixes a couple of typos.
BUG=angleproject:2005
Change-Id: I5af77d82257536b9eb79e26afa502f5b91ff6d31
Reviewed-on: https://chromium-review.googlesource.com/915861
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/tests/gl_tests/ProgramBinaryTest.cpp b/src/tests/gl_tests/ProgramBinaryTest.cpp
index 852501e..b2925b5 100644
--- a/src/tests/gl_tests/ProgramBinaryTest.cpp
+++ b/src/tests/gl_tests/ProgramBinaryTest.cpp
@@ -267,11 +267,7 @@
// We can't run the test if no program binary formats are supported.
GLint binaryFormatCount = 0;
glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &binaryFormatCount);
- if (binaryFormatCount == 0)
- {
- std::cout << "Test skipped because no program binary formats available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!binaryFormatCount);
const std::string &vertexShader =
"#version 300 es\n"
@@ -357,11 +353,7 @@
{
// TODO(jmadill): Investigate Intel failure.
// http://anglebug.com/1637
- if (IsWindows() && IsOpenGL() && IsIntel())
- {
- std::cout << "Test skipped on Windows Intel OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsWindows() && IsOpenGL() && IsIntel());
testBinaryAndUBOBlockIndexes(false);
}
@@ -388,11 +380,7 @@
// We can't run the test if no program binary formats are supported.
GLint binaryFormatCount = 0;
glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &binaryFormatCount);
- if (binaryFormatCount == 0)
- {
- std::cout << "Test skipped because no program binary formats available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!binaryFormatCount);
const std::string &computeShader =
"#version 310 es\n"
@@ -503,18 +491,9 @@
// should not internally cause a vertex shader recompile (for conversion).
TEST_P(ProgramBinaryTransformFeedbackTest, GetTransformFeedbackVarying)
{
- if (!extensionEnabled("GL_OES_get_program_binary"))
- {
- std::cout << "Test skipped because GL_OES_get_program_binary is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_OES_get_program_binary"));
- if (getAvailableProgramBinaryFormatCount() == 0)
- {
- std::cout << "Test skipped because no program binary formats are available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!getAvailableProgramBinaryFormatCount());
std::vector<uint8_t> binary(0);
GLint programLength = 0;
@@ -718,17 +697,11 @@
angle::PlatformParameters secondRenderer = GetParam().loadParams;
bool expectedLinkResult = GetParam().expectedLinkResult;
- if (!(IsPlatformAvailable(firstRenderer)))
- {
- std::cout << "First renderer not supported, skipping test";
- return;
- }
+ // First renderer not supported, skipping test.
+ ANGLE_SKIP_TEST_IF(!(IsPlatformAvailable(firstRenderer)));
- if (!(IsPlatformAvailable(secondRenderer)))
- {
- std::cout << "Second renderer not supported, skipping test";
- return;
- }
+ // Second renderer not supported, skipping test.
+ ANGLE_SKIP_TEST_IF(!(IsPlatformAvailable(secondRenderer)));
EGLWindow *eglWindow = nullptr;
std::vector<uint8_t> binary(0);
@@ -757,13 +730,10 @@
auto basicRenderPos = rendererString.find(std::string("microsoft basic render"));
auto softwareAdapterPos = rendererString.find(std::string("software adapter"));
- if (basicRenderPos != std::string::npos || softwareAdapterPos != std::string::npos)
- {
- // The first renderer is using WARP, even though we didn't explictly request it
- // We should skip this test
- std::cout << "Test skipped on when default GPU is WARP." << std::endl;
- return;
- }
+ // The first renderer is using WARP, even though we didn't explictly request it
+ // We should skip this test
+ ANGLE_SKIP_TEST_IF(basicRenderPos != std::string::npos ||
+ softwareAdapterPos != std::string::npos);
}
// Create a program