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/BindUniformLocationTest.cpp b/src/tests/gl_tests/BindUniformLocationTest.cpp
index 2984447..bc42b2e 100644
--- a/src/tests/gl_tests/BindUniformLocationTest.cpp
+++ b/src/tests/gl_tests/BindUniformLocationTest.cpp
@@ -55,12 +55,7 @@
// Test basic functionality of GL_CHROMIUM_bind_uniform_location
TEST_P(BindUniformLocationTest, Basic)
{
- if (!extensionEnabled("GL_CHROMIUM_bind_uniform_location"))
- {
- std::cout << "Test skipped because GL_CHROMIUM_bind_uniform_location is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
ASSERT_NE(mBindUniformLocation, nullptr);
@@ -126,12 +121,7 @@
// Test that conflicts are detected when two uniforms are bound to the same location
TEST_P(BindUniformLocationTest, ConflictsDetection)
{
- if (!extensionEnabled("GL_CHROMIUM_bind_uniform_location"))
- {
- std::cout << "Test skipped because GL_CHROMIUM_bind_uniform_location is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
ASSERT_NE(nullptr, mBindUniformLocation);
@@ -182,12 +172,7 @@
// Test a use case of the chromium compositor
TEST_P(BindUniformLocationTest, Compositor)
{
- if (!extensionEnabled("GL_CHROMIUM_bind_uniform_location"))
- {
- std::cout << "Test skipped because GL_CHROMIUM_bind_uniform_location is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
ASSERT_NE(nullptr, mBindUniformLocation);
@@ -292,12 +277,7 @@
// Test that unused uniforms don't conflict when bound to the same location
TEST_P(BindUniformLocationTest, UnusedUniformUpdate)
{
- if (!extensionEnabled("GL_CHROMIUM_bind_uniform_location"))
- {
- std::cout << "Test skipped because GL_CHROMIUM_bind_uniform_location is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
ASSERT_NE(nullptr, mBindUniformLocation);
@@ -397,12 +377,7 @@
// binding the sampler to a location higher than the amount of active uniforms.
TEST_P(BindUniformLocationTest, UseSamplerWhenUnusedUniforms)
{
- if (!extensionEnabled("GL_CHROMIUM_bind_uniform_location"))
- {
- std::cout << "Test skipped because GL_CHROMIUM_bind_uniform_location is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
ASSERT_NE(nullptr, mBindUniformLocation);
@@ -446,12 +421,7 @@
// This is valid according to the extension spec.
TEST_P(BindUniformLocationTest, SameLocationForUsedAndUnusedUniform)
{
- if (!extensionEnabled("GL_CHROMIUM_bind_uniform_location"))
- {
- std::cout << "Test skipped because GL_CHROMIUM_bind_uniform_location is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
ASSERT_NE(nullptr, mBindUniformLocation);
@@ -520,12 +490,7 @@
// bindUniformLocation API sets a consistent location.
TEST_P(BindUniformLocationES31Test, ConsistentWithLocationLayoutQualifier)
{
- if (!extensionEnabled("GL_CHROMIUM_bind_uniform_location"))
- {
- std::cout << "Test skipped because GL_CHROMIUM_bind_uniform_location is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
const std::string vsSource =
"#version 310 es\n"
@@ -566,12 +531,7 @@
// location should prevail.
TEST_P(BindUniformLocationES31Test, LocationLayoutQualifierOverridesAPIBinding)
{
- if (!extensionEnabled("GL_CHROMIUM_bind_uniform_location"))
- {
- std::cout << "Test skipped because GL_CHROMIUM_bind_uniform_location is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
const std::string vsSource =
"#version 310 es\n"
@@ -615,12 +575,7 @@
// fail.
TEST_P(BindUniformLocationES31Test, LocationLayoutQualifierConflictsWithAPIBinding)
{
- if (!extensionEnabled("GL_CHROMIUM_bind_uniform_location"))
- {
- std::cout << "Test skipped because GL_CHROMIUM_bind_uniform_location is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_bind_uniform_location"));
const std::string vsSource =
"#version 310 es\n"
diff --git a/src/tests/gl_tests/BlendMinMaxTest.cpp b/src/tests/gl_tests/BlendMinMaxTest.cpp
index e43848a..b76c1bb 100644
--- a/src/tests/gl_tests/BlendMinMaxTest.cpp
+++ b/src/tests/gl_tests/BlendMinMaxTest.cpp
@@ -39,11 +39,7 @@
void runTest(GLenum colorFormat, GLenum type)
{
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_blend_minmax"))
- {
- std::cout << "Test skipped because ES3 or GL_EXT_blend_minmax is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_blend_minmax"));
SetUpFramebuffer(colorFormat);
@@ -187,31 +183,19 @@
TEST_P(BlendMinMaxTest, RGBA32F)
{
- if (getClientMajorVersion() < 3 || !extensionEnabled("GL_EXT_color_buffer_float"))
- {
- std::cout << "Test skipped because ES3 and GL_EXT_color_buffer_float are not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 ||
+ !extensionEnabled("GL_EXT_color_buffer_float"));
- // TODO (bug 1284): Investigate RGBA32f D3D SDK Layers messages on D3D11_FL9_3
- if (IsD3D11_FL93())
- {
- std::cout << "Test skipped on Feature Level 9_3." << std::endl;
- return;
- }
+ // Ignore SDK layers messages on D3D11 FL 9.3 (http://anglebug.com/1284)
+ ANGLE_SKIP_TEST_IF(IsD3D11_FL93());
runTest(GL_RGBA32F, GL_FLOAT);
}
TEST_P(BlendMinMaxTest, RGBA16F)
{
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_color_buffer_half_float"))
- {
- std::cout << "Test skipped because ES3 or GL_EXT_color_buffer_half_float is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
+ !extensionEnabled("GL_EXT_color_buffer_half_float"));
runTest(GL_RGBA16F, GL_FLOAT);
}
diff --git a/src/tests/gl_tests/BlitFramebufferANGLETest.cpp b/src/tests/gl_tests/BlitFramebufferANGLETest.cpp
index 6558a3c..6e8de98 100644
--- a/src/tests/gl_tests/BlitFramebufferANGLETest.cpp
+++ b/src/tests/gl_tests/BlitFramebufferANGLETest.cpp
@@ -792,12 +792,8 @@
TEST_P(BlitFramebufferANGLETest, BlitStencil)
{
// TODO(jmadill): Figure out if we can fix this on D3D9.
- // https://code.google.com/p/angleproject/issues/detail?id=809
- if (IsIntel() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE)
- {
- std::cout << "Test skipped on Intel D3D9." << std::endl;
- return;
- }
+ // https://code.google.com/p/angleproject/issues/detail?id=2205
+ ANGLE_SKIP_TEST_IF(IsIntel() && IsD3D9());
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
@@ -805,7 +801,7 @@
// fill the stencil buffer with 0x1
glStencilFunc(GL_ALWAYS, 0x1, 0xFF);
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
- glEnable(GL_STENCIL_TEST);
+ glEnable(GL_STENCIL_TEST);
drawQuad(mCheckerProgram, "position", 0.3f);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER_ANGLE, mOriginalFBO);
diff --git a/src/tests/gl_tests/BufferDataTest.cpp b/src/tests/gl_tests/BufferDataTest.cpp
index 6a3e5a4..eaef559 100644
--- a/src/tests/gl_tests/BufferDataTest.cpp
+++ b/src/tests/gl_tests/BufferDataTest.cpp
@@ -237,11 +237,7 @@
TEST_P(IndexedBufferCopyTest, IndexRangeBug)
{
// TODO(geofflang): Figure out why this fails on AMD OpenGL (http://anglebug.com/1291)
- if (IsAMD() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
- {
- std::cout << "Test disabled on AMD OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL());
unsigned char vertexData[] = { 255, 0, 0, 0, 0, 0 };
unsigned int indexData[] = { 0, 1 };
diff --git a/src/tests/gl_tests/CopyCompressedTextureTest.cpp b/src/tests/gl_tests/CopyCompressedTextureTest.cpp
index 4d41519..747fffd 100644
--- a/src/tests/gl_tests/CopyCompressedTextureTest.cpp
+++ b/src/tests/gl_tests/CopyCompressedTextureTest.cpp
@@ -120,17 +120,9 @@
// Test to ensure that the basic functionality of the extension works.
TEST_P(CopyCompressedTextureTest, Basic)
{
- if (!checkExtensions())
- {
- return;
- }
+ ANGLE_SKIP_TEST_IF(!checkExtensions());
- if (!extensionEnabled("GL_EXT_texture_compression_dxt1"))
- {
- std::cout << "Test skipped because GL_EXT_texture_compression_dxt1 is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_compression_dxt1"));
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
diff --git a/src/tests/gl_tests/CopyTextureTest.cpp b/src/tests/gl_tests/CopyTextureTest.cpp
index c8c6d13..153209a 100644
--- a/src/tests/gl_tests/CopyTextureTest.cpp
+++ b/src/tests/gl_tests/CopyTextureTest.cpp
@@ -150,14 +150,9 @@
return;
}
- if (getClientMajorVersion() < 3 &&
- (!extensionEnabled("GL_EXT_texture_storage") || !extensionEnabled("GL_OES_rgb8_rgba8")))
- {
- std::cout
- << "Test skipped due to missing ES3 or GL_EXT_texture_storage or GL_OES_rgb8_rgba8"
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(
+ getClientMajorVersion() < 3 &&
+ (!extensionEnabled("GL_EXT_texture_storage") || !extensionEnabled("GL_OES_rgb8_rgba8")));
GLColor pixels = GLColor::red;
@@ -683,18 +678,10 @@
return;
}
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_fbo_render_mipmap"))
- {
- std::cout << "Test skipped because ES3 or GL_OES_fbo_render_mipmap is missing."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
+ !extensionEnabled("GL_OES_fbo_render_mipmap"));
- if (IsOSX() && IsIntel())
- {
- std::cout << "Test skipped on Mac Intel." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOSX() && IsIntel());
GLColor pixels[] = {GLColor::red, GLColor::red, GLColor::red, GLColor::red};
@@ -1168,11 +1155,7 @@
return;
}
- if (!extensionEnabled("GL_EXT_color_buffer_float"))
- {
- std::cout << "Test skipped due to missing GL_EXT_color_buffer_float." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_color_buffer_float"));
auto testOutput = [this](GLuint texture, const GLColor32F &expectedColor) {
const std::string vs =
diff --git a/src/tests/gl_tests/D3DTextureTest.cpp b/src/tests/gl_tests/D3DTextureTest.cpp
index 2a21c04..d6898f5 100644
--- a/src/tests/gl_tests/D3DTextureTest.cpp
+++ b/src/tests/gl_tests/D3DTextureTest.cpp
@@ -895,10 +895,7 @@
}
// Multisampling is not supported on D3D9 or OpenGL.
- if (IsD3D9() || IsOpenGL())
- {
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsD3D9() || IsOpenGL());
constexpr size_t bufferSize = 32;
diff --git a/src/tests/gl_tests/DXT1CompressedTextureTest.cpp b/src/tests/gl_tests/DXT1CompressedTextureTest.cpp
index fae32ca..dc3798e 100644
--- a/src/tests/gl_tests/DXT1CompressedTextureTest.cpp
+++ b/src/tests/gl_tests/DXT1CompressedTextureTest.cpp
@@ -74,11 +74,7 @@
TEST_P(DXT1CompressedTextureTest, CompressedTexImage)
{
- if (!extensionEnabled("GL_EXT_texture_compression_dxt1"))
- {
- std::cout << "Test skipped because GL_EXT_texture_compression_dxt1 is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_compression_dxt1"));
GLuint texture;
glGenTextures(1, &texture);
@@ -115,18 +111,11 @@
TEST_P(DXT1CompressedTextureTest, CompressedTexStorage)
{
- if (!extensionEnabled("GL_EXT_texture_compression_dxt1"))
- {
- std::cout << "Test skipped due to missing GL_EXT_texture_compression_dxt1" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_compression_dxt1"));
- if (getClientMajorVersion() < 3 &&
- (!extensionEnabled("GL_EXT_texture_storage") || !extensionEnabled("GL_OES_rgb8_rgba8")))
- {
- std::cout << "Test skipped due to missing ES3 or GL_EXT_texture_storage or GL_OES_rgb8_rgba8" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(
+ getClientMajorVersion() < 3 &&
+ (!extensionEnabled("GL_EXT_texture_storage") || !extensionEnabled("GL_OES_rgb8_rgba8")));
GLuint texture;
glGenTextures(1, &texture);
@@ -174,11 +163,7 @@
// Test validation of glCompressedTexSubImage2D with DXT formats
TEST_P(DXT1CompressedTextureTest, CompressedTexSubImageValidation)
{
- if (!extensionEnabled("GL_EXT_texture_compression_dxt1"))
- {
- std::cout << "Test skipped due to missing GL_EXT_texture_compression_dxt1" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_compression_dxt1"));
GLTexture texture;
glBindTexture(GL_TEXTURE_2D, texture.get());
@@ -225,12 +210,7 @@
TEST_P(DXT1CompressedTextureTestES3, PBOCompressedTexImage)
{
- if (!extensionEnabled("GL_EXT_texture_compression_dxt1"))
- {
- std::cout << "Test skipped because GL_EXT_texture_compression_dxt1 is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_compression_dxt1"));
GLuint texture;
glGenTextures(1, &texture);
diff --git a/src/tests/gl_tests/DXTSRGBCompressedTextureTest.cpp b/src/tests/gl_tests/DXTSRGBCompressedTextureTest.cpp
index 0aa9422..b38428c 100644
--- a/src/tests/gl_tests/DXTSRGBCompressedTextureTest.cpp
+++ b/src/tests/gl_tests/DXTSRGBCompressedTextureTest.cpp
@@ -93,13 +93,7 @@
void runTest(GLenum format)
{
- if (!extensionEnabled("GL_EXT_texture_compression_s3tc_srgb"))
- {
- std::cout
- << "Test skipped because GL_EXT_texture_compression_s3tc_srgb is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_compression_s3tc_srgb"));
const TestCase &test = kTests.at(format);
diff --git a/src/tests/gl_tests/DebugMarkerTest.cpp b/src/tests/gl_tests/DebugMarkerTest.cpp
index bafee8e..f779a64 100644
--- a/src/tests/gl_tests/DebugMarkerTest.cpp
+++ b/src/tests/gl_tests/DebugMarkerTest.cpp
@@ -31,11 +31,7 @@
// The debug markers can be validated by capturing this test under PIX/Graphics Diagnostics.
TEST_P(DebugMarkerTest, BasicValidation)
{
- if (!extensionEnabled("GL_EXT_debug_marker"))
- {
- std::cout << "Test skipped due to missing GL_EXT_debug_marker" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_debug_marker"));
std::string eventMarkerCaption = "Test event marker caption";
std::string groupMarkerCaption = "Test group marker caption";
diff --git a/src/tests/gl_tests/DebugTest.cpp b/src/tests/gl_tests/DebugTest.cpp
index c07acea..0ce7a3c 100644
--- a/src/tests/gl_tests/DebugTest.cpp
+++ b/src/tests/gl_tests/DebugTest.cpp
@@ -73,11 +73,7 @@
// Test that when debug output is disabled, no message are outputted
TEST_P(DebugTest, DisabledOutput)
{
- if (!mDebugExtensionAvailable)
- {
- std::cout << "Test skipped because GL_KHR_debug is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!mDebugExtensionAvailable);
glDisable(GL_DEBUG_OUTPUT);
@@ -98,11 +94,7 @@
// Test a basic flow of inserting a message and reading it back
TEST_P(DebugTest, InsertMessage)
{
- if (!mDebugExtensionAvailable)
- {
- std::cout << "Test skipped because GL_KHR_debug is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!mDebugExtensionAvailable);
const GLenum source = GL_DEBUG_SOURCE_APPLICATION;
const GLenum type = GL_DEBUG_TYPE_OTHER;
@@ -146,11 +138,7 @@
// Test inserting multiple messages
TEST_P(DebugTest, InsertMessageMultiple)
{
- if (!mDebugExtensionAvailable)
- {
- std::cout << "Test skipped because GL_KHR_debug is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!mDebugExtensionAvailable);
const GLenum source = GL_DEBUG_SOURCE_APPLICATION;
const GLenum type = GL_DEBUG_TYPE_OTHER;
@@ -208,11 +196,7 @@
// Test using a debug callback
TEST_P(DebugTest, DebugCallback)
{
- if (!mDebugExtensionAvailable)
- {
- std::cout << "Test skipped because GL_KHR_debug is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!mDebugExtensionAvailable);
std::vector<Message> messages;
@@ -246,11 +230,7 @@
// Test the glGetPointervKHR entry point
TEST_P(DebugTest, GetPointer)
{
- if (!mDebugExtensionAvailable)
- {
- std::cout << "Test skipped because GL_KHR_debug is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!mDebugExtensionAvailable);
std::vector<Message> messages;
@@ -268,11 +248,7 @@
// Test usage of message control. Example taken from GL_KHR_debug spec.
TEST_P(DebugTest, MessageControl1)
{
- if (!mDebugExtensionAvailable)
- {
- std::cout << "Test skipped because GL_KHR_debug is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!mDebugExtensionAvailable);
std::vector<Message> messages;
@@ -320,11 +296,7 @@
// Test usage of message control. Example taken from GL_KHR_debug spec.
TEST_P(DebugTest, MessageControl2)
{
- if (!mDebugExtensionAvailable)
- {
- std::cout << "Test skipped because GL_KHR_debug is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!mDebugExtensionAvailable);
std::vector<Message> messages;
@@ -372,11 +344,7 @@
// Test basic usage of setting and getting labels
TEST_P(DebugTest, ObjectLabels)
{
- if (!mDebugExtensionAvailable)
- {
- std::cout << "Test skipped because GL_KHR_debug is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!mDebugExtensionAvailable);
GLuint renderbuffer = 0;
glGenRenderbuffers(1, &renderbuffer);
@@ -408,11 +376,7 @@
// Test basic usage of setting and getting labels
TEST_P(DebugTest, ObjectPtrLabels)
{
- if (!mDebugExtensionAvailable || getClientMajorVersion() < 3)
- {
- std::cout << "Test skipped because GL_KHR_debug or ES3 is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!mDebugExtensionAvailable || getClientMajorVersion() < 3);
GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
diff --git a/src/tests/gl_tests/DiscardFramebufferEXTTest.cpp b/src/tests/gl_tests/DiscardFramebufferEXTTest.cpp
index 0e91b0d..408add6 100644
--- a/src/tests/gl_tests/DiscardFramebufferEXTTest.cpp
+++ b/src/tests/gl_tests/DiscardFramebufferEXTTest.cpp
@@ -26,11 +26,7 @@
TEST_P(DiscardFramebufferEXTTest, DefaultFramebuffer)
{
- if (!extensionEnabled("EXT_discard_framebuffer"))
- {
- std::cout << "Test skipped because EXT_discard_framebuffer is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("EXT_discard_framebuffer"));
// These should succeed on the default framebuffer
const GLenum discards1[] = { GL_COLOR_EXT };
@@ -65,11 +61,7 @@
TEST_P(DiscardFramebufferEXTTest, NonDefaultFramebuffer)
{
- if (!extensionEnabled("EXT_discard_framebuffer"))
- {
- std::cout << "Test skipped because EXT_discard_framebuffer is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("EXT_discard_framebuffer"));
GLuint tex2D;
GLuint framebuffer;
diff --git a/src/tests/gl_tests/DrawBuffersTest.cpp b/src/tests/gl_tests/DrawBuffersTest.cpp
index 1a788ad..28b7624 100644
--- a/src/tests/gl_tests/DrawBuffersTest.cpp
+++ b/src/tests/gl_tests/DrawBuffersTest.cpp
@@ -222,41 +222,26 @@
TEST_P(DrawBuffersTest, VerifyD3DLimits)
{
EGLPlatformParameters platform = GetParam().eglParameters;
- if (platform.renderer == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
+
+ ANGLE_SKIP_TEST_IF(platform.renderer != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE);
+ if (platform.majorVersion == 9 && platform.minorVersion == 3)
{
- if (platform.majorVersion == 9 && platform.minorVersion == 3)
- {
- // D3D11 Feature Level 9_3 supports 4 draw buffers
- ASSERT_EQ(mMaxDrawBuffers, 4);
- }
- else
- {
- // D3D11 Feature Level 10_0+ supports 8 draw buffers
- ASSERT_EQ(mMaxDrawBuffers, 8);
- }
+ // D3D11 Feature Level 9_3 supports 4 draw buffers
+ ASSERT_EQ(mMaxDrawBuffers, 4);
}
else
{
- std::cout << "Test skipped for non-D3D11 renderers." << std::endl;
- return;
+ // D3D11 Feature Level 10_0+ supports 8 draw buffers
+ ASSERT_EQ(mMaxDrawBuffers, 8);
}
}
TEST_P(DrawBuffersTest, Gaps)
{
- if (!checkSupport())
- {
- std::cout << "Test skipped because ES3 or GL_EXT_draw_buffers is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!checkSupport());
- if (IsWindows() && IsAMD() && IsDesktopOpenGL())
- {
- // TODO(ynovikov): Investigate the failure (http://anglebug.com/1535)
- std::cout << "Test disabled on Windows AMD OpenGL." << std::endl;
- return;
- }
+ // TODO(ynovikov): Investigate the failure (http://anglebug.com/1535)
+ ANGLE_SKIP_TEST_IF(IsWindows() && IsAMD() && IsDesktopOpenGL());
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, mTextures[0], 0);
@@ -281,19 +266,10 @@
TEST_P(DrawBuffersTest, FirstAndLast)
{
- if (!checkSupport())
- {
- std::cout << "Test skipped because ES3 or GL_EXT_draw_buffers is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!checkSupport());
- if (IsWindows() && IsAMD() && IsDesktopOpenGL())
- {
- // TODO(ynovikov): Investigate the failure (https://anglebug.com/1533)
- std::cout << "Test disabled on Windows AMD OpenGL." << std::endl;
- return;
- }
+ // TODO(ynovikov): Investigate the failure (https://anglebug.com/1533)
+ ANGLE_SKIP_TEST_IF(IsWindows() && IsAMD() && IsDesktopOpenGL());
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextures[0], 0);
@@ -327,19 +303,10 @@
TEST_P(DrawBuffersTest, FirstHalfNULL)
{
- if (!checkSupport())
- {
- std::cout << "Test skipped because ES3 or GL_EXT_draw_buffers is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!checkSupport());
- if (IsWindows() && IsAMD() && IsDesktopOpenGL())
- {
- // TODO(ynovikov): Investigate the failure (https://anglebug.com/1533)
- std::cout << "Test disabled on Windows AMD OpenGL." << std::endl;
- return;
- }
+ // TODO(ynovikov): Investigate the failure (https://anglebug.com/1533)
+ ANGLE_SKIP_TEST_IF(IsWindows() && IsAMD() && IsDesktopOpenGL());
bool flags[8] = { false };
GLenum bufs[8] = { GL_NONE };
@@ -372,12 +339,7 @@
TEST_P(DrawBuffersTest, UnwrittenOutputVariablesShouldNotCrash)
{
- if (!checkSupport())
- {
- std::cout << "Test skipped because ES3 or GL_EXT_draw_buffers is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!checkSupport());
// Bind two render targets but use a shader which writes only to the first one.
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
@@ -413,11 +375,7 @@
TEST_P(DrawBuffersTest, BroadcastGLFragColor)
{
- if (!extensionEnabled("GL_EXT_draw_buffers"))
- {
- std::cout << "Test skipped because EGL_EXT_draw_buffers is not enabled." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_draw_buffers"));
// Bind two render targets. gl_FragColor should be broadcast to both.
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
diff --git a/src/tests/gl_tests/ErrorMessages.cpp b/src/tests/gl_tests/ErrorMessages.cpp
index ddd3d58..2ab9e99 100644
--- a/src/tests/gl_tests/ErrorMessages.cpp
+++ b/src/tests/gl_tests/ErrorMessages.cpp
@@ -75,15 +75,9 @@
// Verify functionality of WebGL specific errors using KHR_debug
TEST_P(ErrorMessagesTest, ErrorMessages)
{
- if (extensionEnabled("GL_KHR_debug"))
- {
- glEnable(GL_DEBUG_OUTPUT);
- }
- else
- {
- std::cout << "Test skipped because GL_KHR_debug is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_KHR_debug"));
+
+ glEnable(GL_DEBUG_OUTPUT);
std::vector<Message> messages;
glDebugMessageCallbackKHR(Callback, &messages);
diff --git a/src/tests/gl_tests/FenceSyncTests.cpp b/src/tests/gl_tests/FenceSyncTests.cpp
index fc44678..48aa1a6 100644
--- a/src/tests/gl_tests/FenceSyncTests.cpp
+++ b/src/tests/gl_tests/FenceSyncTests.cpp
@@ -41,11 +41,7 @@
// FenceNV objects should respond false to glIsFenceNV until they've been set
TEST_P(FenceNVTest, IsFence)
{
- if (!extensionEnabled("GL_NV_fence"))
- {
- std::cout << "Test skipped due to missing GL_NV_fence extension." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_NV_fence"));
GLuint fence = 0;
glGenFencesNV(1, &fence);
@@ -64,11 +60,7 @@
// Test error cases for all FenceNV functions
TEST_P(FenceNVTest, Errors)
{
- if (!extensionEnabled("GL_NV_fence"))
- {
- std::cout << "Test skipped due to missing GL_NV_fence extension." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_NV_fence"));
EXPECT_GL_TRUE(glTestFenceNV(10)) << "glTestFenceNV should still return TRUE for an invalid "
"fence and generate an INVALID_OPERATION";
@@ -111,11 +103,7 @@
// Test that basic usage works and doesn't generate errors or crash
TEST_P(FenceNVTest, BasicOperations)
{
- if (!extensionEnabled("GL_NV_fence"))
- {
- std::cout << "Test skipped due to missing GL_NV_fence extension." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_NV_fence"));
glClearColor(1.0f, 0.0f, 1.0f, 1.0f);
diff --git a/src/tests/gl_tests/FramebufferRenderMipmapTest.cpp b/src/tests/gl_tests/FramebufferRenderMipmapTest.cpp
index 852dcf8..edc6287 100644
--- a/src/tests/gl_tests/FramebufferRenderMipmapTest.cpp
+++ b/src/tests/gl_tests/FramebufferRenderMipmapTest.cpp
@@ -119,11 +119,7 @@
{
bool renderToMipmapSupported =
extensionEnabled("GL_OES_fbo_render_mipmap") || getClientMajorVersion() > 2;
- if (!renderToMipmapSupported)
- {
- std::cout << "Test skipped because GL_OES_fbo_render_mipmap or ES3 is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!renderToMipmapSupported);
const GLfloat levelColors[] =
{
diff --git a/src/tests/gl_tests/FramebufferTest.cpp b/src/tests/gl_tests/FramebufferTest.cpp
index ece99b0..f932a34 100644
--- a/src/tests/gl_tests/FramebufferTest.cpp
+++ b/src/tests/gl_tests/FramebufferTest.cpp
@@ -193,64 +193,41 @@
TEST_P(FramebufferFormatsTest, RGBA4)
{
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_texture_storage"))
- {
- std::cout << "Test skipped due to missing ES3 or GL_EXT_texture_storage." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_texture_storage"));
testTextureFormat(GL_RGBA4, 4, 4, 4, 4);
}
TEST_P(FramebufferFormatsTest, RGB565)
{
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_texture_storage"))
- {
- std::cout << "Test skipped due to missing ES3 or GL_EXT_texture_storage." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_texture_storage"));
testTextureFormat(GL_RGB565, 5, 6, 5, 0);
}
TEST_P(FramebufferFormatsTest, RGB8)
{
- if (getClientMajorVersion() < 3 &&
- (!extensionEnabled("GL_OES_rgb8_rgba8") || !extensionEnabled("GL_EXT_texture_storage")))
- {
- std::cout
- << "Test skipped due to missing ES3 or GL_OES_rgb8_rgba8 and GL_EXT_texture_storage."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(
+ getClientMajorVersion() < 3 &&
+ (!extensionEnabled("GL_OES_rgb8_rgba8") || !extensionEnabled("GL_EXT_texture_storage")));
testTextureFormat(GL_RGB8_OES, 8, 8, 8, 0);
}
TEST_P(FramebufferFormatsTest, BGRA8)
{
- if (!extensionEnabled("GL_EXT_texture_format_BGRA8888") ||
- (getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_texture_storage")))
- {
- std::cout << "Test skipped due to missing GL_EXT_texture_format_BGRA8888 or "
- "GL_EXT_texture_storage."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("GL_EXT_texture_format_BGRA8888") ||
+ (getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_texture_storage")));
testTextureFormat(GL_BGRA8_EXT, 8, 8, 8, 8);
}
TEST_P(FramebufferFormatsTest, RGBA8)
{
- if (getClientMajorVersion() < 3 &&
- (!extensionEnabled("GL_OES_rgb8_rgba8") || !extensionEnabled("GL_EXT_texture_storage")))
- {
- std::cout
- << "Test skipped due to missing ES3 or GL_OES_rgb8_rgba8 and GL_EXT_texture_storage."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(
+ getClientMajorVersion() < 3 &&
+ (!extensionEnabled("GL_OES_rgb8_rgba8") || !extensionEnabled("GL_EXT_texture_storage")));
testTextureFormat(GL_RGBA8_OES, 8, 8, 8, 8);
}
@@ -267,11 +244,7 @@
TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH32F)
{
- if (getClientMajorVersion() < 3)
- {
- std::cout << "Test skipped due to missing ES3." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3);
testRenderbufferMultisampleFormat(3, GL_DEPTH_ATTACHMENT, GL_DEPTH_COMPONENT32F);
}
@@ -283,11 +256,7 @@
TEST_P(FramebufferFormatsTest, RenderbufferMultisample_DEPTH32F_STENCIL8)
{
- if (getClientMajorVersion() < 3)
- {
- std::cout << "Test skipped due to missing ES3." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3);
testRenderbufferMultisampleFormat(3, GL_DEPTH_STENCIL_ATTACHMENT, GL_DEPTH32F_STENCIL8);
}
@@ -295,11 +264,7 @@
TEST_P(FramebufferFormatsTest, RenderbufferMultisample_STENCIL_INDEX8)
{
// TODO(geofflang): Figure out how to support GLSTENCIL_INDEX8 on desktop GL
- if (GetParam().getRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
- {
- std::cout << "Test skipped on Desktop OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsDesktopOpenGL());
testRenderbufferMultisampleFormat(2, GL_STENCIL_ATTACHMENT, GL_STENCIL_INDEX8);
}
@@ -351,11 +316,7 @@
// Test that a renderbuffer with zero height but nonzero width is handled without crashes/asserts.
TEST_P(FramebufferFormatsTest, ZeroHeightRenderbuffer)
{
- if (getClientMajorVersion() < 3)
- {
- std::cout << "Test skipped due to missing ES3" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3);
testZeroHeightRenderbuffer();
}
diff --git a/src/tests/gl_tests/GLSLTest.cpp b/src/tests/gl_tests/GLSLTest.cpp
index 7a6f18d..45ef2d5 100644
--- a/src/tests/gl_tests/GLSLTest.cpp
+++ b/src/tests/gl_tests/GLSLTest.cpp
@@ -542,11 +542,7 @@
// (http://anglebug.com/1292)
// TODO(geofflang): Find out why this doesn't compile on AMD OpenGL drivers
// (http://anglebug.com/1291)
- if (IsDesktopOpenGL() && (IsOSX() || !IsNVIDIA()))
- {
- std::cout << "Test disabled on this OpenGL configuration." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsDesktopOpenGL() && (IsOSX() || !IsNVIDIA()));
const std::string fragmentShaderSource =
R"(precision mediump float;
@@ -821,11 +817,7 @@
{
// TODO: ESSL 3.00 -> GLSL 1.20 translation should add "invariant" in fragment shader
// for varyings which are invariant in vertex shader (http://anglebug.com/1293)
- if (IsDesktopOpenGL())
- {
- std::cout << "Test disabled on OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsDesktopOpenGL());
const std::string fragmentShaderSource =
"#version 300 es\n"
@@ -963,11 +955,7 @@
// TODO: ESSL 1.00 -> GLSL 1.20 translation should add "invariant" in fragment shader
// for varyings which are invariant in vertex shader individually,
// and remove invariant(all) from fragment shader (http://anglebug.com/1293)
- if (IsDesktopOpenGL())
- {
- std::cout << "Test disabled on OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsDesktopOpenGL());
const std::string fragmentShaderSource =
"#pragma STDGL invariant(all)\n"
@@ -1144,13 +1132,8 @@
// TODO(cwallez) remove the suppression once NVIDIA drivers are updated across trybots, drivers
// since late 2016 should have the fix. Last check on 2017-05-30 revealed that the Windows
// Server 2008 bots still had the old, failing drivers.
- if (IsNVIDIA() && IsOpenGLES())
- {
- std::cout << "Test skipped on NVIDIA OpenGL ES because it disallows returning "
- "structure of arrays"
- << std::endl;
- return;
- }
+ // It disallows returning structure of arrays on NVIDIA OpenGL ES.
+ ANGLE_SKIP_TEST_IF(IsNVIDIA() && IsOpenGLES());
const std::string vertexShaderSource =
"#version 300 es\n"
@@ -1255,11 +1238,7 @@
// TODO: ESSL 3.00 -> GLSL 1.20 translation should add "invariant" in fragment shader
// for varyings which are invariant in vertex shader,
// because of invariant(all) being used in vertex shader (http://anglebug.com/1293)
- if (IsDesktopOpenGL())
- {
- std::cout << "Test disabled on OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsDesktopOpenGL());
const std::string fragmentShaderSource =
"#version 300 es\n"
@@ -1281,15 +1260,9 @@
TEST_P(GLSLTest, MaxVaryingVec4)
{
-#if defined(__APPLE__)
- // TODO(geofflang): Find out why this doesn't compile on Apple AND OpenGL drivers
+ // TODO(geofflang): Find out why this doesn't compile on Apple AMD OpenGL drivers
// (http://anglebug.com/1291)
- if (IsAMD() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
- {
- std::cout << "Test disabled on Apple AMD OpenGL." << std::endl;
- return;
- }
-#endif
+ ANGLE_SKIP_TEST_IF(IsOSX() && IsAMD() && IsOpenGL());
GLint maxVaryings = 0;
glGetIntegerv(GL_MAX_VARYING_VECTORS, &maxVaryings);
@@ -1392,22 +1365,12 @@
// Only fails on D3D9 because of packing limitations.
TEST_P(GLSLTest, TwiceMaxVaryingVec2)
{
- if (getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE)
- {
- // TODO(geofflang): Figure out why this fails on NVIDIA's GLES driver
- std::cout << "Test disabled on OpenGL ES." << std::endl;
- return;
- }
+ // TODO(geofflang): Figure out why this fails on NVIDIA's GLES driver
+ ANGLE_SKIP_TEST_IF(IsNVIDIA() && IsOpenGLES());
-#if defined(__APPLE__)
- // TODO(geofflang): Find out why this doesn't compile on Apple AND OpenGL drivers
+ // TODO(geofflang): Find out why this doesn't compile on Apple AMD OpenGL drivers
// (http://anglebug.com/1291)
- if (IsAMD() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
- {
- std::cout << "Test disabled on Apple AMD OpenGL." << std::endl;
- return;
- }
-#endif
+ ANGLE_SKIP_TEST_IF(IsOSX() && IsAMD() && IsOpenGL());
GLint maxVaryings = 0;
glGetIntegerv(GL_MAX_VARYING_VECTORS, &maxVaryings);
@@ -1418,28 +1381,14 @@
// Disabled because of a failure in D3D9
TEST_P(GLSLTest, MaxVaryingVec2Arrays)
{
- if (IsD3DSM3())
- {
- std::cout << "Test disabled on SM3." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsD3DSM3());
- if (getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE)
- {
- // TODO(geofflang): Figure out why this fails on NVIDIA's GLES driver
- std::cout << "Test disabled on OpenGL ES." << std::endl;
- return;
- }
+ // TODO(geofflang): Figure out why this fails on NVIDIA's GLES driver
+ ANGLE_SKIP_TEST_IF(IsOpenGLES());
-#if defined(__APPLE__)
- // TODO(geofflang): Find out why this doesn't compile on Apple AND OpenGL drivers
+ // TODO(geofflang): Find out why this doesn't compile on Apple AMD OpenGL drivers
// (http://anglebug.com/1291)
- if (IsAMD() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
- {
- std::cout << "Test disabled on Apple AMD OpenGL." << std::endl;
- return;
- }
-#endif
+ ANGLE_SKIP_TEST_IF(IsOSX() && IsAMD() && IsOpenGL());
GLint maxVaryings = 0;
glGetIntegerv(GL_MAX_VARYING_VECTORS, &maxVaryings);
@@ -1809,12 +1758,7 @@
// can actually be used along with the maximum number of texture samplers.
TEST_P(GLSLTest, VerifyMaxVertexUniformVectorsWithSamplers)
{
- if (GetParam().eglParameters.renderer == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE ||
- GetParam().eglParameters.renderer == EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE)
- {
- std::cout << "Test disabled on OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOpenGL() || IsOpenGLES());
int maxUniforms = 10000;
glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, &maxUniforms);
@@ -1858,12 +1802,7 @@
// can actually be used along with the maximum number of texture samplers.
TEST_P(GLSLTest, VerifyMaxFragmentUniformVectorsWithSamplers)
{
- if (GetParam().eglParameters.renderer == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE ||
- GetParam().eglParameters.renderer == EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE)
- {
- std::cout << "Test disabled on OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOpenGL() || IsOpenGLES());
int maxUniforms = 10000;
glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &maxUniforms);
@@ -1891,11 +1830,7 @@
// Test compiling shaders using the GL_EXT_shader_texture_lod extension
TEST_P(GLSLTest, TextureLOD)
{
- if (!extensionEnabled("GL_EXT_shader_texture_lod"))
- {
- std::cout << "Test skipped due to missing GL_EXT_shader_texture_lod." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_shader_texture_lod"));
const std::string source =
"#extension GL_EXT_shader_texture_lod : require\n"
@@ -2056,11 +1991,7 @@
TEST_P(GLSLTest_ES3, InitGlobalArrayWithArrayIndexing)
{
// TODO(ynovikov): re-enable once root cause of http://anglebug.com/1428 is fixed
- if (IsAndroid() && IsAdreno() && IsOpenGLES())
- {
- std::cout << "Test skipped on Adreno OpenGLES on Android." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsAdreno() && IsOpenGLES());
const std::string vertexShaderSource =
"#version 300 es\n"
@@ -2089,10 +2020,7 @@
// Test that index-constant sampler array indexing is supported.
TEST_P(GLSLTest, IndexConstantSamplerArrayIndexing)
{
- if (IsD3D11_FL93()) {
- std::cout << "Test skipped on D3D11 FL 9.3." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsD3D11_FL93());
const std::string vertexShaderSource =
"attribute vec4 vPosition;\n"
@@ -2461,12 +2389,7 @@
// Test that using a sampler2D and samplerExternalOES in the same shader works (anglebug.com/1534)
TEST_P(GLSLTest, ExternalAnd2DSampler)
{
- if (!extensionEnabled("GL_OES_EGL_image_external"))
- {
- std::cout << "Test skipped because GL_OES_EGL_image_external is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_OES_EGL_image_external"));
const std::string fragmentShader =
R"(
@@ -2718,11 +2641,7 @@
TEST_P(GLSLTest_ES31, FindMSBAndFindLSBCornerCases)
{
// Suspecting AMD driver bug - failure seen on bots running on AMD R5 230.
- if (IsAMD() && IsOpenGL() && IsLinux())
- {
- std::cout << "Test skipped on AMD OpenGL Linux" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL() && IsLinux());
// Failing on N5X Oreo http://anglebug.com/2304
ANGLE_SKIP_TEST_IF(IsAndroid() && IsAdreno() && IsOpenGLES());
@@ -2751,13 +2670,8 @@
// Test that writing into a swizzled vector that is dynamically indexed succeeds.
TEST_P(GLSLTest_ES3, WriteIntoDynamicIndexingOfSwizzledVector)
{
- if (IsOpenGL())
- {
- // http://anglebug.com/1924
- std::cout << "Test skipped on all OpenGL configurations because it has incorrect results"
- << std::endl;
- return;
- }
+ // http://anglebug.com/1924
+ ANGLE_SKIP_TEST_IF(IsOpenGL());
// The shader first assigns v.x to v.z (1.0)
// Then v.y to v.y (2.0)
@@ -2786,11 +2700,8 @@
{
// This seems to be bugged on some version of Android. Might not affect the newest versions.
// TODO(jmadill): Lift suppression when Chromium bots are upgraded.
- if (IsAndroid() && IsOpenGLES())
- {
- std::cout << "Test skipped on Android because of bug with Nexus 5X." << std::endl;
- return;
- }
+ // Test skipped on Android because of bug with Nexus 5X.
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsOpenGLES());
const std::string &vertexShader =
"#version 300 es\n"
@@ -2914,14 +2825,9 @@
// Test that uninitialized local variables are initialized to 0.
TEST_P(GLSLTest_ES3, InitUninitializedLocals)
{
- if (IsAndroid() && IsOpenGLES())
- {
- // http://anglebug.com/2046
- std::cout
- << "Test skipped on Android GLES because local variable initialization is disabled."
- << std::endl;
- return;
- }
+ // Test skipped on Android GLES because local variable initialization is disabled.
+ // http://anglebug.com/2046
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsOpenGLES());
const std::string &fragmentShader =
"#version 300 es\n"
@@ -2956,14 +2862,9 @@
// specifically tests with two different struct variables declared in the same block.
TEST_P(GLSLTest, InitUninitializedStructContainingArrays)
{
- if (IsAndroid() && IsOpenGLES())
- {
- // http://anglebug.com/2046
- std::cout
- << "Test skipped on Android GLES because local variable initialization is disabled."
- << std::endl;
- return;
- }
+ // Test skipped on Android GLES because local variable initialization is disabled.
+ // http://anglebug.com/2046
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsOpenGLES());
const std::string &fragmentShader =
"precision mediump float;\n"
@@ -3045,14 +2946,9 @@
// Test that an uninitialized nameless struct inside a for loop init statement works.
TEST_P(GLSLTest_ES3, UninitializedNamelessStructInForInitStatement)
{
- if (IsAndroid() && IsOpenGLES())
- {
- // http://anglebug.com/2046
- std::cout
- << "Test skipped on Android GLES because local variable initialization is disabled."
- << std::endl;
- return;
- }
+ // Test skipped on Android GLES because local variable initialization is disabled.
+ // http://anglebug.com/2046
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsOpenGLES());
const std::string &fragmentShader =
"#version 300 es\n"
@@ -3290,12 +3186,8 @@
// This test covers passing an array of structs containing samplers as a function argument.
TEST_P(GLSLTest, ArrayOfStructsWithSamplersAsFunctionArg)
{
- if (IsAndroid() && IsAdreno() && IsOpenGLES())
- {
- // Shader failed to compile on Android. http://anglebug.com/2114
- std::cout << "Test skipped on Adreno OpenGLES on Android." << std::endl;
- return;
- }
+ // Shader failed to compile on Android. http://anglebug.com/2114
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsAdreno() && IsOpenGLES());
const std::string &vertexShader =
"attribute vec2 position;\n"
@@ -3352,12 +3244,8 @@
// This test covers passing a struct containing an array of samplers as a function argument.
TEST_P(GLSLTest, StructWithSamplerArrayAsFunctionArg)
{
- if (IsAndroid() && IsAdreno() && IsOpenGLES())
- {
- // Shader failed to compile on Android. http://anglebug.com/2114
- std::cout << "Test skipped on Adreno OpenGLES on Android." << std::endl;
- return;
- }
+ // Shader failed to compile on Android. http://anglebug.com/2114
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsAdreno() && IsOpenGLES());
const std::string &vertexShader =
"attribute vec2 position;\n"
diff --git a/src/tests/gl_tests/ImageTest.cpp b/src/tests/gl_tests/ImageTest.cpp
index cb88c48..66b2394 100644
--- a/src/tests/gl_tests/ImageTest.cpp
+++ b/src/tests/gl_tests/ImageTest.cpp
@@ -409,15 +409,10 @@
TEST_P(ImageTest, ValidationImageBase)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_2D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"));
GLuint glTexture2D;
glGenTextures(1, &glTexture2D);
@@ -548,13 +543,8 @@
TEST_P(ImageTest, ValidationGLImage)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base"))
- {
- std::cout << "Test skipped because OES_EGL_image or EGL_KHR_image_base is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("OES_EGL_image") ||
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base"));
EGLDisplay display = window->getDisplay();
EGLContext context = window->getContext();
@@ -803,15 +793,10 @@
TEST_P(ImageTest, ValidationGLEGLImage)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_2D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"));
GLubyte data[4] = {255, 0, 255, 255};
@@ -858,12 +843,7 @@
// Check validation from the GL_OES_EGL_image_external extension
TEST_P(ImageTest, ValidationGLEGLImageExternal)
{
- if (!extensionEnabled("GL_OES_EGL_image_external"))
- {
- std::cout << "Test skipped because GL_OES_EGL_image_external is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_OES_EGL_image_external"));
GLuint texture;
glGenTextures(1, &texture);
@@ -941,12 +921,7 @@
// Check validation from the GL_OES_EGL_image_external_essl3 extension
TEST_P(ImageTest, ValidationGLEGLImageExternalESSL3)
{
- if (!extensionEnabled("GL_OES_EGL_image_external_essl3"))
- {
- std::cout << "Test skipped because GL_OES_EGL_image_external is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_OES_EGL_image_external_essl3"));
// Make sure this extension is not exposed without ES3.
ASSERT_GE(getClientMajorVersion(), 3);
@@ -971,15 +946,10 @@
TEST_P(ImageTest, Source2DTarget2D)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_2D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"));
GLubyte data[4] = {255, 0, 255, 255};
@@ -1004,15 +974,10 @@
TEST_P(ImageTest, Source2DTargetRenderbuffer)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_2D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"));
GLubyte data[4] = {255, 0, 255, 255};
@@ -1037,16 +1002,10 @@
TEST_P(ImageTest, Source2DTargetExternal)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"))
- {
- std::cout
- << "Test skipped because OES_EGL_image, OES_EGL_image_external, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_2D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"));
GLubyte data[4] = {255, 0, 255, 255};
@@ -1071,16 +1030,10 @@
TEST_P(ImageTestES3, Source2DTargetExternalESSL3)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external_essl3") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external_essl3") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, OES_EGL_image_external_essl3, "
- "EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_2D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"));
GLubyte data[4] = {255, 0, 255, 255};
@@ -1105,15 +1058,10 @@
TEST_P(ImageTest, SourceCubeTarget2D)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_cubemap_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_cubemap_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_cubemap_image"));
GLubyte data[24] = {
255, 0, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255,
@@ -1146,15 +1094,10 @@
TEST_P(ImageTest, SourceCubeTargetRenderbuffer)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_cubemap_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_cubemap_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_cubemap_image"));
GLubyte data[24] = {
255, 0, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255,
@@ -1188,16 +1131,10 @@
TEST_P(ImageTest, SourceCubeTargetExternal)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_cubemap_image"))
- {
- std::cout
- << "Test skipped because OES_EGL_image, OES_EGL_image_external, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_cubemap_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_cubemap_image"));
GLubyte data[24] = {
255, 0, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255,
@@ -1231,16 +1168,10 @@
TEST_P(ImageTestES3, SourceCubeTargetExternalESSL3)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external_essl3") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external_essl3") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_cubemap_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, OES_EGL_image_external_essl3, "
- "EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_cubemap_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_cubemap_image"));
GLubyte data[24] = {
255, 0, 255, 255, 255, 255, 255, 255, 255, 0, 0, 255,
@@ -1273,21 +1204,12 @@
TEST_P(ImageTest, Source3DTargetTexture)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_3D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_3D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_3D_image"));
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_texture_3D"))
- {
- std::cout << "Test skipped because 3D textures are not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_texture_3D"));
const size_t depth = 2;
GLubyte data[4 * depth] = {
@@ -1319,21 +1241,12 @@
TEST_P(ImageTest, Source3DTargetRenderbuffer)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_3D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_3D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_3D_image"));
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_texture_3D"))
- {
- std::cout << "Test skipped because 3D textures are not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_texture_3D"));
const size_t depth = 2;
GLubyte data[4 * depth] = {
@@ -1366,22 +1279,12 @@
TEST_P(ImageTest, Source3DTargetExternal)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_3D_image"))
- {
- std::cout
- << "Test skipped because OES_EGL_image, OES_EGL_image_external, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_3D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_3D_image"));
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_texture_3D"))
- {
- std::cout << "Test skipped because 3D textures are not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_texture_3D"));
const size_t depth = 2;
GLubyte data[4 * depth] = {
@@ -1414,22 +1317,12 @@
TEST_P(ImageTestES3, Source3DTargetExternalESSL3)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external_essl3") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external_essl3") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_3D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, OES_EGL_image_external_essl3, "
- "EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_3D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_3D_image"));
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_texture_3D"))
- {
- std::cout << "Test skipped because 3D textures are not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_texture_3D"));
const size_t depth = 2;
GLubyte data[4 * depth] = {
@@ -1461,15 +1354,10 @@
TEST_P(ImageTest, SourceRenderbufferTargetTexture)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_renderbuffer_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_renderbuffer_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_renderbuffer_image"));
GLubyte data[4] = {255, 0, 255, 255};
@@ -1495,16 +1383,10 @@
TEST_P(ImageTest, SourceRenderbufferTargetTextureExternal)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_renderbuffer_image"))
- {
- std::cout
- << "Test skipped because OES_EGL_image, OES_EGL_image_external, EGL_KHR_image_base or "
- "EGL_KHR_gl_renderbuffer_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_renderbuffer_image"));
GLubyte data[4] = {255, 0, 255, 255};
@@ -1530,16 +1412,10 @@
TEST_P(ImageTestES3, SourceRenderbufferTargetTextureExternalESSL3)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external_essl3") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") || !extensionEnabled("OES_EGL_image_external_essl3") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_renderbuffer_image"))
- {
- std::cout
- << "Test skipped because OES_EGL_image, OES_EGL_image_external, EGL_KHR_image_base or "
- "EGL_KHR_gl_renderbuffer_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_renderbuffer_image"));
GLubyte data[4] = {255, 0, 255, 255};
@@ -1564,15 +1440,10 @@
TEST_P(ImageTest, SourceRenderbufferTargetRenderbuffer)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_renderbuffer_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_renderbuffer_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_renderbuffer_image"));
GLubyte data[4] = {255, 0, 255, 255};
@@ -1600,15 +1471,10 @@
TEST_P(ImageTest, Deletion)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_2D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"));
GLubyte originalData[4] = {255, 0, 255, 255};
GLubyte updateData[4] = {0, 255, 0, 255};
@@ -1661,15 +1527,10 @@
TEST_P(ImageTest, MipLevels)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_2D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"));
const size_t mipLevels = 3;
const size_t textureSize = 4;
@@ -1734,15 +1595,10 @@
TEST_P(ImageTest, Respecification)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_2D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"));
GLubyte originalData[4] = {255, 0, 255, 255};
GLubyte updateData[4] = {0, 255, 0, 255};
@@ -1777,15 +1633,10 @@
TEST_P(ImageTest, RespecificationWithFBO)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_2D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"));
// Simple shader
const std::string &vertexSource =
@@ -1846,15 +1697,10 @@
TEST_P(ImageTest, RespecificationOfOtherLevel)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_2D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"));
GLubyte originalData[2 * 2 * 4] = {
255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255, 255, 0, 255, 255,
@@ -1904,15 +1750,10 @@
TEST_P(ImageTest, UpdatedData)
{
EGLWindow *window = getEGLWindow();
- if (!extensionEnabled("OES_EGL_image") ||
+ ANGLE_SKIP_TEST_IF(
+ !extensionEnabled("OES_EGL_image") ||
!eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_image_base") ||
- !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"))
- {
- std::cout << "Test skipped because OES_EGL_image, EGL_KHR_image_base or "
- "EGL_KHR_gl_texture_2D_image is not available."
- << std::endl;
- return;
- }
+ !eglDisplayExtensionEnabled(window->getDisplay(), "EGL_KHR_gl_texture_2D_image"));
GLubyte originalData[4] = {255, 0, 255, 255};
GLubyte updateData[4] = {0, 255, 0, 255};
diff --git a/src/tests/gl_tests/IndexBufferOffsetTest.cpp b/src/tests/gl_tests/IndexBufferOffsetTest.cpp
index d344c17..fe85d52 100644
--- a/src/tests/gl_tests/IndexBufferOffsetTest.cpp
+++ b/src/tests/gl_tests/IndexBufferOffsetTest.cpp
@@ -132,12 +132,8 @@
// Test using an offset for an UInt32 index buffer
TEST_P(IndexBufferOffsetTest, UInt32Index)
{
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_element_index_uint"))
- {
- std::cout << "Test skipped because ES3 or GL_OES_element_index_uint is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
+ !extensionEnabled("GL_OES_element_index_uint"));
GLuint indexData[] = {0, 1, 2, 1, 2, 3};
runTest(GL_UNSIGNED_INT, 4, indexData);
diff --git a/src/tests/gl_tests/IndexedPointsTest.cpp b/src/tests/gl_tests/IndexedPointsTest.cpp
index 9199947..eba685b 100644
--- a/src/tests/gl_tests/IndexedPointsTest.cpp
+++ b/src/tests/gl_tests/IndexedPointsTest.cpp
@@ -285,11 +285,7 @@
TEST_P(IndexedPointsTestUShort, VertexWithColorUnsignedShortOffsetChangingIndices)
{
// TODO(fjhenigman): Figure out why this fails on Ozone Intel.
- if (IsOzone() && IsIntel() && IsOpenGLES())
- {
- std::cout << "Test skipped on Ozone Intel." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOzone() && IsIntel() && IsOpenGLES());
runTest(3, true);
runTest(1, true);
diff --git a/src/tests/gl_tests/MaxTextureSizeTest.cpp b/src/tests/gl_tests/MaxTextureSizeTest.cpp
index 7686134..526bed4 100644
--- a/src/tests/gl_tests/MaxTextureSizeTest.cpp
+++ b/src/tests/gl_tests/MaxTextureSizeTest.cpp
@@ -216,11 +216,8 @@
TEST_P(MaxTextureSizeTest, RenderToTexture)
{
- if (getClientMajorVersion() < 3 && (!extensionEnabled("GL_ANGLE_framebuffer_blit")))
- {
- std::cout << "Test skipped due to missing glBlitFramebuffer[ANGLE] support." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
+ (!extensionEnabled("GL_ANGLE_framebuffer_blit")));
GLuint fbo = 0;
GLuint textureId = 0;
diff --git a/src/tests/gl_tests/MipmapTest.cpp b/src/tests/gl_tests/MipmapTest.cpp
index 83f4a48..f631fe6 100644
--- a/src/tests/gl_tests/MipmapTest.cpp
+++ b/src/tests/gl_tests/MipmapTest.cpp
@@ -663,12 +663,9 @@
// Regression test for a bug that cause mipmaps to only generate using the top left corner as input.
TEST_P(MipmapTest, MipMapGenerationD3D9Bug)
{
- if (!extensionEnabled("GL_EXT_texture_storage") || !extensionEnabled("GL_OES_rgb8_rgba8") ||
- !extensionEnabled("GL_ANGLE_texture_usage"))
- {
- std::cout << "Test skipped due to missing extensions." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_storage") ||
+ !extensionEnabled("GL_OES_rgb8_rgba8") ||
+ !extensionEnabled("GL_ANGLE_texture_usage"));
const GLColor mip0Color[4] = {
GLColor::red, GLColor::green, GLColor::red, GLColor::green,
@@ -915,12 +912,8 @@
// the levelbase array, are left unchanged by this computation."
TEST_P(MipmapTestES3, GenerateMipmapBaseLevel)
{
- if (IsAMD() && IsDesktopOpenGL())
- {
- // Observed incorrect rendering on AMD, sampling level 2 returns black.
- std::cout << "Test skipped on AMD OpenGL." << std::endl;
- return;
- }
+ // Observed incorrect rendering on AMD, sampling level 2 returns black.
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsDesktopOpenGL());
glBindTexture(GL_TEXTURE_2D, mTexture);
@@ -970,12 +963,8 @@
// the levelbase array, are left unchanged by this computation."
TEST_P(MipmapTestES3, GenerateMipmapCubeBaseLevel)
{
- if (IsAMD() && IsDesktopOpenGL())
- {
- // Observed incorrect rendering on AMD, sampling level 2 returns black.
- std::cout << "Test skipped on AMD OpenGL." << std::endl;
- return;
- }
+ // Observed incorrect rendering on AMD, sampling level 2 returns black.
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsDesktopOpenGL());
ASSERT_EQ(getWindowWidth(), getWindowHeight());
@@ -1009,13 +998,9 @@
clearAndDrawQuad(mCubeProgram, getWindowWidth() / 4, getWindowHeight() / 4);
EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 8, getWindowHeight() / 8, GLColor::red);
- if (IsNVIDIA() && IsOpenGL())
- {
- // Observed incorrect rendering on NVIDIA, level zero seems to be incorrectly affected by
- // GenerateMipmap.
- std::cout << "Test partially skipped on NVIDIA OpenGL." << std::endl;
- return;
- }
+ // Observed incorrect rendering on NVIDIA, level zero seems to be incorrectly affected by
+ // GenerateMipmap.
+ ANGLE_SKIP_TEST_IF(IsNVIDIA() && IsOpenGL());
// Draw using level 0. It should still be blue.
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_BASE_LEVEL, 0);
@@ -1129,22 +1114,12 @@
// A native version of the WebGL2 test tex-base-level-bug.html
TEST_P(MipmapTestES3, BaseLevelTextureBug)
{
- if (IsOpenGL() && IsAMD())
- {
- std::cout << "Test skipped on Windows AMD OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOpenGL() && IsAMD());
-#if defined(ANGLE_PLATFORM_APPLE)
// Regression in 10.12.4 needing workaround -- crbug.com/705865.
// Seems to be passing on AMD GPUs. Definitely not NVIDIA.
// Probably not Intel.
- if (IsNVIDIA() || IsIntel())
- {
- std::cout << "Test skipped on macOS with NVIDIA and Intel GPUs." << std::endl;
- return;
- }
-#endif
+ ANGLE_SKIP_TEST_IF(IsOSX() && (IsNVIDIA() || IsIntel()));
glBindTexture(GL_TEXTURE_2D, mTexture);
glTexImage2D(GL_TEXTURE_2D, 2, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, &GLColor::red);
diff --git a/src/tests/gl_tests/MultisampleCompatibilityTest.cpp b/src/tests/gl_tests/MultisampleCompatibilityTest.cpp
index e2203be..daa6904 100644
--- a/src/tests/gl_tests/MultisampleCompatibilityTest.cpp
+++ b/src/tests/gl_tests/MultisampleCompatibilityTest.cpp
@@ -245,11 +245,7 @@
return;
// TODO: Figure out why this fails on Android.
- if (IsAndroid())
- {
- std::cout << "Test skipped on Android." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAndroid());
// SAMPLE_ALPHA_TO_ONE is specified to transform alpha values of
// covered samples to 1.0. In order to detect it, we use non-1.0
@@ -397,11 +393,7 @@
return;
// TODO: Figure out why this fails on Android.
- if (IsAndroid())
- {
- std::cout << "Test skipped on Android." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAndroid());
const std::string &vertex =
"attribute vec4 position;\n"
diff --git a/src/tests/gl_tests/MultiviewDrawTest.cpp b/src/tests/gl_tests/MultiviewDrawTest.cpp
index 58d50ea..0ed643b 100644
--- a/src/tests/gl_tests/MultiviewDrawTest.cpp
+++ b/src/tests/gl_tests/MultiviewDrawTest.cpp
@@ -762,17 +762,9 @@
// 2) does not generate any error if the number of views in the draw framebuffer is 1.
TEST_P(MultiviewDrawValidationTest, ActiveTimeElapsedQuery)
{
- if (!requestMultiviewExtension())
- {
- return;
- }
+ ANGLE_SKIP_TEST_IF(!requestMultiviewExtension());
- if (!extensionEnabled("GL_EXT_disjoint_timer_query"))
- {
- std::cout << "Test skipped because GL_EXT_disjoint_timer_query is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_disjoint_timer_query"));
const GLint viewportOffsets[4] = {0, 0, 2, 0};
const std::string &vsSource =
diff --git a/src/tests/gl_tests/OcclusionQueriesTest.cpp b/src/tests/gl_tests/OcclusionQueriesTest.cpp
index 1e7cf33..6bfaab9 100644
--- a/src/tests/gl_tests/OcclusionQueriesTest.cpp
+++ b/src/tests/gl_tests/OcclusionQueriesTest.cpp
@@ -59,12 +59,8 @@
TEST_P(OcclusionQueriesTest, IsOccluded)
{
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_occlusion_query_boolean"))
- {
- std::cout << "Test skipped because ES3 or GL_EXT_occlusion_query_boolean are not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
+ !extensionEnabled("GL_EXT_occlusion_query_boolean"));
glDepthMask(GL_TRUE);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
@@ -106,12 +102,8 @@
TEST_P(OcclusionQueriesTest, IsNotOccluded)
{
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_occlusion_query_boolean"))
- {
- std::cout << "Test skipped because ES3 or GL_EXT_occlusion_query_boolean are not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
+ !extensionEnabled("GL_EXT_occlusion_query_boolean"));
glDepthMask(GL_TRUE);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
@@ -140,12 +132,8 @@
TEST_P(OcclusionQueriesTest, Errors)
{
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_occlusion_query_boolean"))
- {
- std::cout << "Test skipped because ES3 or GL_EXT_occlusion_query_boolean are not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
+ !extensionEnabled("GL_EXT_occlusion_query_boolean"));
glDepthMask(GL_TRUE);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
@@ -204,20 +192,13 @@
// result for each query. Helps expose bugs in ANGLE's virtual contexts.
TEST_P(OcclusionQueriesTest, MultiContext)
{
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_occlusion_query_boolean"))
- {
- std::cout << "Test skipped because ES3 or GL_EXT_occlusion_query_boolean are not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
+ !extensionEnabled("GL_EXT_occlusion_query_boolean"));
- if (GetParam() == ES2_D3D9() || GetParam() == ES2_D3D11() || GetParam() == ES3_D3D11())
- {
- std::cout << "Test skipped because the D3D backends cannot support simultaneous queries on "
- "multiple contexts yet."
- << std::endl;
- return;
- }
+ // Test skipped because the D3D backends cannot support simultaneous queries on multiple
+ // contexts yet.
+ ANGLE_SKIP_TEST_IF(GetParam() == ES2_D3D9() || GetParam() == ES2_D3D11() ||
+ GetParam() == ES3_D3D11());
glDepthMask(GL_TRUE);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
diff --git a/src/tests/gl_tests/PbufferTest.cpp b/src/tests/gl_tests/PbufferTest.cpp
index 19a174a..90ed8e4 100644
--- a/src/tests/gl_tests/PbufferTest.cpp
+++ b/src/tests/gl_tests/PbufferTest.cpp
@@ -112,11 +112,7 @@
// Test clearing a Pbuffer and checking the color is correct
TEST_P(PbufferTest, Clearing)
{
- if (!mSupportsPbuffers)
- {
- std::cout << "Test skipped because Pbuffers are not supported." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!mSupportsPbuffers);
EGLWindow *window = getEGLWindow();
@@ -149,17 +145,9 @@
// Bind the Pbuffer to a texture and verify it renders correctly
TEST_P(PbufferTest, BindTexImage)
{
- if (!mSupportsPbuffers)
- {
- std::cout << "Test skipped because Pbuffers are not supported." << std::endl;
- return;
- }
-
- if (!mSupportsBindTexImage)
- {
- std::cout << "Test skipped because Pbuffer does not support binding to RGBA textures." << std::endl;
- return;
- }
+ // Test skipped because Pbuffers are not supported or Pbuffer does not support binding to RGBA
+ // textures.
+ ANGLE_SKIP_TEST_IF(!mSupportsPbuffers || !mSupportsBindTexImage);
EGLWindow *window = getEGLWindow();
@@ -260,17 +248,9 @@
// Bind a Pbuffer, redefine the texture, and verify it renders correctly
TEST_P(PbufferTest, BindTexImageAndRedefineTexture)
{
- if (!mSupportsPbuffers)
- {
- std::cout << "Test skipped because Pbuffers are not supported." << std::endl;
- return;
- }
-
- if (!mSupportsBindTexImage)
- {
- std::cout << "Test skipped because Pbuffer does not support binding to RGBA textures." << std::endl;
- return;
- }
+ // Test skipped because Pbuffers are not supported or Pbuffer does not support binding to RGBA
+ // textures.
+ ANGLE_SKIP_TEST_IF(!mSupportsPbuffers || !mSupportsBindTexImage);
EGLWindow *window = getEGLWindow();
diff --git a/src/tests/gl_tests/PointSpritesTest.cpp b/src/tests/gl_tests/PointSpritesTest.cpp
index 36a43de..457ebae 100644
--- a/src/tests/gl_tests/PointSpritesTest.cpp
+++ b/src/tests/gl_tests/PointSpritesTest.cpp
@@ -39,11 +39,7 @@
{
// TODO(jmadill): Investigate potential AMD driver bug.
// http://anglebug.com/1643
- if (IsAMD() && IsDesktopOpenGL() && IsWindows())
- {
- std::cout << "Test skipped on desktop GL AMD Windows." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsDesktopOpenGL() && IsWindows());
const std::string fs =
R"(precision mediump float;
@@ -141,11 +137,7 @@
{
// TODO(jmadill): Investigate potential AMD driver bug.
// http://anglebug.com/1643
- if (IsAMD() && IsDesktopOpenGL() && IsWindows())
- {
- std::cout << "Test skipped on desktop GL AMD Windows." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsDesktopOpenGL() && IsWindows());
const std::string fs =
R"(precision mediump float;
@@ -179,11 +171,7 @@
{
// TODO(jmadill): Investigate potential AMD driver bug.
// http://anglebug.com/1643
- if (IsAMD() && IsDesktopOpenGL() && IsWindows())
- {
- std::cout << "Test skipped on desktop GL AMD Windows." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsDesktopOpenGL() && IsWindows());
const std::string fs =
R"(precision mediump float;
@@ -263,11 +251,7 @@
{
// TODO(jmadill): Investigate potential AMD driver bug.
// http://anglebug.com/1643
- if (IsAMD() && IsDesktopOpenGL() && IsWindows())
- {
- std::cout << "Test skipped on desktop GL AMD Windows." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsDesktopOpenGL() && IsWindows());
const std::string fs =
R"(precision mediump float;
@@ -480,21 +464,13 @@
// 3.4.
TEST_P(PointSpritesTest, PointSizeAboveMaxIsClamped)
{
- if (IsD3D9())
- {
- // Failed on NVIDIA GeForce GTX 1080 - no pixels from the point were detected in the
- // framebuffer. http://anglebug.com/2111
- std::cout << "Test skipped on D3D9." << std::endl;
- return;
- }
+ // Failed on NVIDIA GeForce GTX 1080 - no pixels from the point were detected in the
+ // framebuffer. http://anglebug.com/2111
+ ANGLE_SKIP_TEST_IF(IsD3D9());
- if (IsAMD() && IsOpenGL())
- {
- // Failed on AMD OSX and Windows trybots - no pixels from the point were detected in the
- // framebuffer. http://anglebug.com/2113
- std::cout << "Test skipped on AMD OpenGL." << std::endl;
- return;
- }
+ // Failed on AMD OSX and Windows trybots - no pixels from the point were detected in the
+ // framebuffer. http://anglebug.com/2113
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL());
GLfloat pointSizeRange[2] = {};
glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, pointSizeRange);
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
diff --git a/src/tests/gl_tests/ProvokingVertexTest.cpp b/src/tests/gl_tests/ProvokingVertexTest.cpp
index 15c4c9d..2f77093 100644
--- a/src/tests/gl_tests/ProvokingVertexTest.cpp
+++ b/src/tests/gl_tests/ProvokingVertexTest.cpp
@@ -140,14 +140,8 @@
// Ensure that any provoking vertex shenanigans still gives correct vertex streams.
TEST_P(ProvokingVertexTest, FlatTriWithTransformFeedback)
{
-// TODO(cwallez) figure out why it is broken on AMD on Mac
-#if defined(ANGLE_PLATFORM_APPLE)
- if (IsAMD())
- {
- std::cout << "Test skipped on AMD on Mac." << std::endl;
- return;
- }
-#endif
+ // TODO(cwallez) figure out why it is broken on AMD on Mac
+ ANGLE_SKIP_TEST_IF(IsOSX() && IsAMD());
glGenTransformFeedbacks(1, &mTransformFeedback);
glBindTransformFeedback(GL_TRANSFORM_FEEDBACK, mTransformFeedback);
@@ -255,11 +249,7 @@
TEST_P(ProvokingVertexTest, FlatTriStripPrimitiveRestart)
{
// TODO(jmadill): Implement on the D3D back-end.
- if (IsD3D11())
- {
- std::cout << "Test disabled on D3D11." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsD3D11());
GLint indexData[] = {0, 1, 2, -1, 1, 2, 3, 4, -1, 3, 4, 5};
GLint vertexData[] = {1, 2, 3, 4, 5, 6};
diff --git a/src/tests/gl_tests/ReadPixelsTest.cpp b/src/tests/gl_tests/ReadPixelsTest.cpp
index 802f5d9..e8603e4 100644
--- a/src/tests/gl_tests/ReadPixelsTest.cpp
+++ b/src/tests/gl_tests/ReadPixelsTest.cpp
@@ -36,11 +36,7 @@
TEST_P(ReadPixelsTest, OutOfBounds)
{
// TODO: re-enable once root cause of http://anglebug.com/1413 is fixed
- if (IsAndroid() && IsAdreno() && IsOpenGLES())
- {
- std::cout << "Test skipped on Adreno OpenGLES on Android." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsAdreno() && IsOpenGLES());
glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
@@ -188,11 +184,7 @@
TEST_P(ReadPixelsPBOTest, ExistingDataPreserved)
{
// TODO(geofflang): Figure out why this fails on AMD OpenGL (http://anglebug.com/1291)
- if (IsAMD() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
- {
- std::cout << "Test disabled on AMD OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL());
// Clear backbuffer to red
glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
diff --git a/src/tests/gl_tests/RobustClientMemoryTest.cpp b/src/tests/gl_tests/RobustClientMemoryTest.cpp
index 62ea8e9..8265188 100644
--- a/src/tests/gl_tests/RobustClientMemoryTest.cpp
+++ b/src/tests/gl_tests/RobustClientMemoryTest.cpp
@@ -359,11 +359,7 @@
}
// TODO(ynovikov): Looks like a driver bug on Intel HD 530 http://anglebug.com/1877
- if (IsLinux() && IsIntel() && IsDesktopOpenGL())
- {
- std::cout << "Test skipped on Intel OpenGL on Linux." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsLinux() && IsIntel() && IsDesktopOpenGL());
GLsizei dataDimension = 16;
std::vector<GLubyte> rgbaData(dataDimension * dataDimension * 4);
diff --git a/src/tests/gl_tests/RobustResourceInitTest.cpp b/src/tests/gl_tests/RobustResourceInitTest.cpp
index 7d07e3a..207346b 100644
--- a/src/tests/gl_tests/RobustResourceInitTest.cpp
+++ b/src/tests/gl_tests/RobustResourceInitTest.cpp
@@ -623,12 +623,8 @@
EGLint surfaceType = 0;
eglGetConfigAttrib(display, config, EGL_SURFACE_TYPE, &surfaceType);
- if ((surfaceType & EGL_PBUFFER_BIT) == 0)
- {
- std::cout << "Test skipped because EGL config cannot be used to create pbuffers."
- << std::endl;
- return;
- }
+ // Test skipped because EGL config cannot be used to create pbuffers.
+ ANGLE_SKIP_TEST_IF((surfaceType & EGL_PBUFFER_BIT) == 0);
EGLint attribs[] = {
EGL_WIDTH, 32,
diff --git a/src/tests/gl_tests/SRGBTextureTest.cpp b/src/tests/gl_tests/SRGBTextureTest.cpp
index b996f04..76e73b7 100644
--- a/src/tests/gl_tests/SRGBTextureTest.cpp
+++ b/src/tests/gl_tests/SRGBTextureTest.cpp
@@ -69,11 +69,7 @@
TEST_P(SRGBTextureTest, SRGBValidation)
{
// TODO(fjhenigman): Figure out why this fails on Ozone Intel.
- if (IsOzone() && IsIntel() && IsOpenGLES())
- {
- std::cout << "Test skipped on Ozone Intel." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOzone() && IsIntel() && IsOpenGLES());
bool supported = extensionEnabled("GL_EXT_sRGB") || getClientMajorVersion() == 3;
@@ -104,11 +100,7 @@
TEST_P(SRGBTextureTest, SRGBAValidation)
{
// TODO(fjhenigman): Figure out why this fails on Ozone Intel.
- if (IsOzone() && IsIntel() && IsOpenGLES())
- {
- std::cout << "Test skipped on Ozone Intel." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOzone() && IsIntel() && IsOpenGLES());
bool supported = extensionEnabled("GL_EXT_sRGB") || getClientMajorVersion() == 3;
@@ -203,18 +195,9 @@
TEST_P(SRGBTextureTest, SRGBDecodeTextureParameter)
{
// TODO(fjhenigman): Figure out why this fails on Ozone Intel.
- if (IsOzone() && IsIntel() && IsOpenGLES())
- {
- std::cout << "Test skipped on Ozone Intel." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOzone() && IsIntel() && IsOpenGLES());
- if (!extensionEnabled("GL_EXT_texture_sRGB_decode"))
- {
- std::cout << "Test skipped because GL_EXT_texture_sRGB_decode is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_sRGB_decode"));
GLColor linearColor(64, 127, 191, 255);
GLColor srgbColor(13, 54, 133, 255);
@@ -243,12 +226,8 @@
// Test basic functionality of SRGB decode using the sampler parameter
TEST_P(SRGBTextureTest, SRGBDecodeSamplerParameter)
{
- if (!extensionEnabled("GL_EXT_texture_sRGB_decode") || getClientMajorVersion() < 3)
- {
- std::cout << "Test skipped because GL_EXT_texture_sRGB_decode or ES3 is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_sRGB_decode") ||
+ getClientMajorVersion() < 3);
GLColor linearColor(64, 127, 191, 255);
GLColor srgbColor(13, 54, 133, 255);
@@ -280,11 +259,7 @@
// Test that mipmaps are generated correctly for sRGB textures
TEST_P(SRGBTextureTest, GenerateMipmaps)
{
- if (getClientMajorVersion() < 3)
- {
- std::cout << "Test skipped because ES3 is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3);
ANGLE_SKIP_TEST_IF(IsOpenGL() && ((IsIntel() && IsOSX()) || IsAMD()));
diff --git a/src/tests/gl_tests/SixteenBppTextureTest.cpp b/src/tests/gl_tests/SixteenBppTextureTest.cpp
index 93ed8b1..fc6ad8c 100644
--- a/src/tests/gl_tests/SixteenBppTextureTest.cpp
+++ b/src/tests/gl_tests/SixteenBppTextureTest.cpp
@@ -358,11 +358,7 @@
TEST_P(SixteenBppTextureTestES3, RGBA4FramebufferReadback)
{
// TODO(jmadill): Fix bug with GLES
- if (IsOpenGLES())
- {
- std::cout << "Test skipped on GLES." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOpenGLES());
Vector4 rawColor(0.5f, 0.7f, 1.0f, 0.0f);
GLColor expectedColor(rawColor);
@@ -416,11 +412,7 @@
TEST_P(SixteenBppTextureTestES3, RGB565FramebufferReadback)
{
// TODO(jmadill): Fix bug with GLES
- if (IsOpenGLES())
- {
- std::cout << "Test skipped on GLES." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOpenGLES());
GLFramebuffer fbo;
glBindFramebuffer(GL_FRAMEBUFFER, fbo.get());
diff --git a/src/tests/gl_tests/StateChangeTest.cpp b/src/tests/gl_tests/StateChangeTest.cpp
index 8952f80..a5bad5e 100644
--- a/src/tests/gl_tests/StateChangeTest.cpp
+++ b/src/tests/gl_tests/StateChangeTest.cpp
@@ -76,12 +76,8 @@
// Ensure that CopyTexImage2D syncs framebuffer changes.
TEST_P(StateChangeTest, CopyTexImage2DSync)
{
- if (IsAMD() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
- {
- // TODO(geofflang): Fix on Linux AMD drivers (http://anglebug.com/1291)
- std::cout << "Test disabled on AMD OpenGL." << std::endl;
- return;
- }
+ // TODO(geofflang): Fix on Linux AMD drivers (http://anglebug.com/1291)
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL());
glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer);
@@ -162,11 +158,7 @@
// Test that caching works when color attachments change with TexStorage.
TEST_P(StateChangeTest, FramebufferIncompleteWithTexStorage)
{
- if (!extensionEnabled("GL_EXT_texture_storage"))
- {
- std::cout << "Test skipped because TexStorage2DEXT not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_storage"));
glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer);
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
@@ -261,18 +253,11 @@
// Test that Framebuffer completeness caching works when depth-stencil attachments change.
TEST_P(StateChangeTest, FramebufferIncompleteDepthStencilAttachment)
{
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_OES_packed_depth_stencil"))
- {
- std::cout << "Test skipped because packed depth+stencil not availble." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 &&
+ !extensionEnabled("GL_OES_packed_depth_stencil"));
- if (IsWindows() && IsIntel() && IsOpenGL())
- {
- // TODO(jmadill): Investigate the failure (https://anglebug.com/1388)
- std::cout << "Test disabled on Windows Intel OpenGL." << std::endl;
- return;
- }
+ // TODO(jmadill): Investigate the failure (https://anglebug.com/1388)
+ ANGLE_SKIP_TEST_IF(IsWindows() && IsIntel() && IsOpenGL());
glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer);
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
diff --git a/src/tests/gl_tests/SwizzleTest.cpp b/src/tests/gl_tests/SwizzleTest.cpp
index 2c83f5c..89eda33 100644
--- a/src/tests/gl_tests/SwizzleTest.cpp
+++ b/src/tests/gl_tests/SwizzleTest.cpp
@@ -347,11 +347,7 @@
TEST_P(SwizzleTest, L32F_2D)
{
- if (!extensionEnabled("GL_OES_texture_float"))
- {
- std::cout << "Test skipped due to missing GL_OES_texture_float." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_OES_texture_float"));
GLfloat data[] = {0.7f};
init2DTexture(GL_LUMINANCE, GL_LUMINANCE, GL_FLOAT, data);
@@ -360,11 +356,7 @@
TEST_P(SwizzleTest, A32F_2D)
{
- if (!extensionEnabled("GL_OES_texture_float"))
- {
- std::cout << "Test skipped due to missing GL_OES_texture_float." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_OES_texture_float"));
GLfloat data[] = {
0.4f,
@@ -375,11 +367,7 @@
TEST_P(SwizzleTest, LA32F_2D)
{
- if (!extensionEnabled("GL_OES_texture_float"))
- {
- std::cout << "Test skipped due to missing GL_OES_texture_float." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_OES_texture_float"));
GLfloat data[] = {
0.5f, 0.6f,
@@ -392,11 +380,7 @@
TEST_P(SwizzleTest, CompressedDXT_2D)
{
- if (!extensionEnabled("GL_EXT_texture_compression_dxt1"))
- {
- std::cout << "Test skipped due to missing GL_EXT_texture_compression_dxt1." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_compression_dxt1"));
init2DCompressedTexture(GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, pixel_0_width, pixel_0_height, pixel_0_size, pixel_0_data);
runTest2D();
diff --git a/src/tests/gl_tests/SyncQueriesTest.cpp b/src/tests/gl_tests/SyncQueriesTest.cpp
index 9833e97..875f17f 100644
--- a/src/tests/gl_tests/SyncQueriesTest.cpp
+++ b/src/tests/gl_tests/SyncQueriesTest.cpp
@@ -42,11 +42,7 @@
// Test basic usage of sync queries
TEST_P(SyncQueriesTest, Basic)
{
- if (!extensionEnabled("GL_CHROMIUM_sync_query"))
- {
- std::cout << "Test skipped because GL_CHROMIUM_sync_query is not available." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_CHROMIUM_sync_query"));
glGenQueriesEXT(1, &mQuery);
glBeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM, mQuery);
@@ -68,12 +64,7 @@
TEST_P(SyncQueriesTest, Validation)
{
// Need the GL_EXT_occlusion_query_boolean extension for the entry points
- if (!extensionEnabled("GL_EXT_occlusion_query_boolean"))
- {
- std::cout << "Test skipped because GL_EXT_occlusion_query_boolean is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_occlusion_query_boolean"));
bool extensionAvailable = extensionEnabled("GL_CHROMIUM_sync_query");
diff --git a/src/tests/gl_tests/TextureTest.cpp b/src/tests/gl_tests/TextureTest.cpp
index 7e8a954..01f58e2 100644
--- a/src/tests/gl_tests/TextureTest.cpp
+++ b/src/tests/gl_tests/TextureTest.cpp
@@ -178,60 +178,26 @@
if (getClientMajorVersion() < 3)
{
- if (!extensionEnabled("GL_EXT_texture_storage"))
- {
- std::cout << "Test skipped due to missing GL_EXT_texture_storage." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_storage") ||
+ !extensionEnabled("GL_OES_texture_float"));
- if (!extensionEnabled("GL_OES_texture_float"))
- {
- std::cout << "Test skipped due to missing GL_OES_texture_float." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF((sourceImageChannels < 3 || destImageChannels < 3) &&
+ !extensionEnabled("GL_EXT_texture_rg"));
- if ((sourceImageChannels < 3 || destImageChannels < 3) && !extensionEnabled("GL_EXT_texture_rg"))
- {
- std::cout << "Test skipped due to missing GL_EXT_texture_rg." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(destImageChannels == 3 &&
+ !extensionEnabled("GL_CHROMIUM_color_buffer_float_rgb"));
- if (destImageChannels == 3 && !extensionEnabled("GL_CHROMIUM_color_buffer_float_rgb"))
- {
- std::cout << "Test skipped due to missing GL_CHROMIUM_color_buffer_float_rgb."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(destImageChannels == 4 &&
+ !extensionEnabled("GL_CHROMIUM_color_buffer_float_rgba"));
- if (destImageChannels == 4 && !extensionEnabled("GL_CHROMIUM_color_buffer_float_rgba"))
- {
- std::cout << "Test skipped due to missing GL_CHROMIUM_color_buffer_float_rgb."
- << std::endl;
- return;
- }
-
- if (destImageChannels <= 2)
- {
- std::cout << "Test skipped because no extensions grant renderability to 1 and 2 "
- "channel floating point textures."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(destImageChannels <= 2);
}
else
{
- if (!extensionEnabled("GL_color_buffer_float"))
- {
- std::cout << "Test skipped due to missing GL_color_buffer_float." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_color_buffer_float"));
- if (destImageChannels == 3 && !extensionEnabled("GL_CHROMIUM_color_buffer_float_rgb"))
- {
- std::cout << "Test skipped due to missing GL_CHROMIUM_color_buffer_float_rgb."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(destImageChannels == 3 &&
+ !extensionEnabled("GL_CHROMIUM_color_buffer_float_rgb"));
}
GLfloat sourceImageData[4][16] =
@@ -1434,12 +1400,7 @@
// Test that glTexSubImage2D works properly when glTexStorage2DEXT has initialized the image with a default color.
TEST_P(Texture2DTest, TexStorage)
{
- if (getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_texture_storage"))
- {
- std::cout << "Test skipped because ES3 or GL_EXT_texture_storage not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() < 3 && !extensionEnabled("GL_EXT_texture_storage"));
int width = getWindowWidth();
int height = getWindowHeight();
@@ -1570,19 +1531,11 @@
TEST_P(Texture2DTest, CopySubImageFloat_RGB_RGB)
{
- if (IsIntel() && IsLinux())
- {
- // TODO(cwallez): Fix on Linux Intel drivers (http://anglebug.com/1346)
- std::cout << "Test disabled on Linux Intel OpenGL." << std::endl;
- return;
- }
+ // TODO(cwallez): Fix on Linux Intel drivers (http://anglebug.com/1346)
+ ANGLE_SKIP_TEST_IF(IsIntel() && IsLinux());
- // TODO (bug 1284): Investigate RGBA32f D3D SDK Layers messages on D3D11_FL9_3
- if (IsD3D11_FL93())
- {
- std::cout << "Test skipped on Feature Level 9_3." << std::endl;
- return;
- }
+ // Ignore SDK layers messages on D3D11 FL 9.3 (http://anglebug.com/1284)
+ ANGLE_SKIP_TEST_IF(IsD3D11_FL93());
testFloatCopySubImage(3, 3);
}
@@ -1599,24 +1552,16 @@
TEST_P(Texture2DTest, CopySubImageFloat_RGBA_RGB)
{
- // TODO (bug 1284): Investigate RGBA32f D3D SDK Layers messages on D3D11_FL9_3
- if (IsD3D11_FL93())
- {
- std::cout << "Test skipped on Feature Level 9_3." << std::endl;
- return;
- }
+ // Ignore SDK layers messages on D3D11 FL 9.3 (http://anglebug.com/1284)
+ ANGLE_SKIP_TEST_IF(IsD3D11_FL93());
testFloatCopySubImage(4, 3);
}
TEST_P(Texture2DTest, CopySubImageFloat_RGBA_RGBA)
{
- // TODO (bug 1284): Investigate RGBA32f D3D SDK Layers messages on D3D11_FL9_3
- if (IsD3D11_FL93())
- {
- std::cout << "Test skipped on Feature Level 9_3." << std::endl;
- return;
- }
+ // Ignore SDK layers messages on D3D11 FL 9.3 (http://anglebug.com/1284)
+ ANGLE_SKIP_TEST_IF(IsD3D11_FL93());
testFloatCopySubImage(4, 4);
}
@@ -1759,12 +1704,9 @@
// have images defined.
TEST_P(Texture2DTestES3, DrawWithLevelsOutsideRangeUndefined)
{
- if (IsAMD() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
- {
- // Observed crashing on AMD. Oddly the crash only happens with 2D textures, not 3D or array.
- std::cout << "Test skipped on AMD OpenGL." << std::endl;
- return;
- }
+ // Observed crashing on AMD. Oddly the crash only happens with 2D textures, not 3D or array.
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL());
+
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, mTexture2D);
std::vector<GLColor> texDataGreen(2u * 2u, GLColor::green);
@@ -1785,12 +1727,9 @@
// Test that drawing works correctly when level 0 is undefined and base level is 1.
TEST_P(Texture2DTestES3, DrawWithLevelZeroUndefined)
{
- if (IsAMD() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
- {
- // Observed crashing on AMD. Oddly the crash only happens with 2D textures, not 3D or array.
- std::cout << "Test skipped on AMD OpenGL." << std::endl;
- return;
- }
+ // Observed crashing on AMD. Oddly the crash only happens with 2D textures, not 3D or array.
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL());
+
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, mTexture2D);
std::vector<GLColor> texDataGreen(2u * 2u, GLColor::green);
@@ -1983,14 +1922,9 @@
ANGLE_SKIP_TEST_IF(IsIntel() && IsWindows() && IsOpenGL());
- if (IsNVIDIA() && (getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE ||
- getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE))
- {
- // NVIDIA was observed drawing color 0,0,0,0 instead of the texture color after the base
- // level was changed.
- std::cout << "Test partially skipped on NVIDIA OpenGL." << std::endl;
- return;
- }
+ // NVIDIA was observed drawing color 0,0,0,0 instead of the texture color after the base
+ // level was changed.
+ ANGLE_SKIP_TEST_IF(IsNVIDIA() && (IsOpenGL() || IsOpenGLES()));
// Switch the level that is being used to the cyan level 2.
glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_BASE_LEVEL, 2);
@@ -2177,19 +2111,13 @@
// Test that changing base level works when it affects the format of the texture.
TEST_P(Texture2DTestES3, TextureFormatChangesWithBaseLevel)
{
- if (IsNVIDIA() && IsOpenGL())
- {
- // Observed rendering corruption on NVIDIA OpenGL.
- std::cout << "Test skipped on NVIDIA OpenGL." << std::endl;
- return;
- }
+ // Observed rendering corruption on NVIDIA OpenGL.
+ ANGLE_SKIP_TEST_IF(IsNVIDIA() && IsOpenGL());
+
ANGLE_SKIP_TEST_IF(IsIntel() && IsWindows() && IsDesktopOpenGL());
- if (IsAMD() && IsDesktopOpenGL())
- {
- // Observed incorrect rendering on AMD OpenGL.
- std::cout << "Test skipped on AMD OpenGL." << std::endl;
- return;
- }
+
+ // Observed incorrect rendering on AMD OpenGL.
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsDesktopOpenGL());
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, mTexture2D);
@@ -2395,11 +2323,8 @@
// Calling textureSize() on the samplers hits the D3D sampler metadata workaround.
TEST_P(TextureSizeTextureArrayTest, BaseLevelVariesInTextureArray)
{
- if (IsAMD() && IsD3D11())
- {
- std::cout << "Test skipped on AMD D3D." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsD3D11());
+
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, mTexture2DA);
GLsizei size = 64;
@@ -2489,17 +2414,10 @@
{
if (extensionEnabled("GL_OES_texture_half_float"))
{
- if (IsNVIDIA() && IsOpenGLES())
- {
- std::cout << "Test skipped on NVIDIA" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsNVIDIA() && IsOpenGLES());
+
// TODO(ynovikov): re-enable once root cause of http://anglebug.com/1420 is fixed
- if (IsAndroid() && IsAdreno() && IsOpenGLES())
- {
- std::cout << "Test skipped on Adreno OpenGLES on Android." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsAdreno() && IsOpenGLES());
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, mTexture2D);
@@ -2655,12 +2573,8 @@
// ES 3.0.4 table 3.24
TEST_P(Texture2DTestES3, TextureCOMPRESSEDRGB8ETC2ImplicitAlpha1)
{
- if (IsOSX() && IsIntel() && IsOpenGL())
- {
- // Seems to fail on OSX 10.12 Intel.
- std::cout << "Test skipped on OSX Intel." << std::endl;
- return;
- }
+ // Seems to fail on OSX 10.12 Intel.
+ ANGLE_SKIP_TEST_IF(IsOSX() && IsIntel() && IsOpenGL());
// http://anglebug.com/2190
ANGLE_SKIP_TEST_IF(IsOSX() && IsNVIDIA() && IsDesktopOpenGL());
@@ -2679,12 +2593,8 @@
// ES 3.0.4 table 3.24
TEST_P(Texture2DTestES3, TextureCOMPRESSEDSRGB8ETC2ImplicitAlpha1)
{
- if (IsOSX() && IsIntel() && IsOpenGL())
- {
- // Seems to fail on OSX 10.12 Intel.
- std::cout << "Test skipped on OSX Intel." << std::endl;
- return;
- }
+ // Seems to fail on OSX 10.12 Intel.
+ ANGLE_SKIP_TEST_IF(IsOSX() && IsIntel() && IsOpenGL());
// http://anglebug.com/2190
ANGLE_SKIP_TEST_IF(IsOSX() && IsNVIDIA() && IsDesktopOpenGL());
@@ -2709,11 +2619,7 @@
TEST_P(SamplerInStructAsFunctionParameterTest, SamplerInStructAsFunctionParameter)
{
// TODO(ynovikov): re-enable once root cause of http://anglebug.com/1427 is fixed
- if (IsAndroid() && IsAdreno() && IsOpenGLES())
- {
- std::cout << "Test skipped on Adreno OpenGLES on Android." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsAdreno() && IsOpenGLES());
runSamplerInStructTest();
}
@@ -2723,11 +2629,8 @@
TEST_P(SamplerInStructArrayAsFunctionParameterTest, SamplerInStructArrayAsFunctionParameter)
{
// TODO(ynovikov): re-enable once root cause of http://anglebug.com/1427 is fixed
- if (IsAndroid() && IsAdreno() && IsOpenGLES())
- {
- std::cout << "Test skipped on Adreno OpenGLES on Android." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsAdreno() && IsOpenGLES());
+
runSamplerInStructTest();
}
@@ -2736,11 +2639,8 @@
TEST_P(SamplerInNestedStructAsFunctionParameterTest, SamplerInNestedStructAsFunctionParameter)
{
// TODO(ynovikov): re-enable once root cause of http://anglebug.com/1427 is fixed
- if (IsAndroid() && IsAdreno() && IsOpenGLES())
- {
- std::cout << "Test skipped on Adreno OpenGLES on Android." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsAdreno() && IsOpenGLES());
+
runSamplerInStructTest();
}
@@ -3196,11 +3096,7 @@
// Test texture formats enabled by the GL_EXT_texture_norm16 extension.
TEST_P(Texture2DNorm16TestES3, TextureNorm16Test)
{
- if (!extensionEnabled("GL_EXT_texture_norm16"))
- {
- std::cout << "Test skipped due to missing GL_EXT_texture_norm16." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_norm16"));
testNorm16Texture(GL_R16_EXT, GL_RED, GL_UNSIGNED_SHORT);
testNorm16Texture(GL_RG16_EXT, GL_RG, GL_UNSIGNED_SHORT);
@@ -3223,11 +3119,7 @@
ANGLE_SKIP_TEST_IF(IsIntel() && IsWindows() && IsDesktopOpenGL());
// TODO(ynovikov): re-enable once root cause of http://anglebug.com/1429 is fixed
- if (IsAndroid() && IsAdreno() && IsOpenGLES())
- {
- std::cout << "Test skipped on Adreno OpenGLES on Android." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAndroid() && IsAdreno() && IsOpenGLES());
glBindTexture(GL_TEXTURE_2D, mTexture2D);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -3291,17 +3183,10 @@
// Test that unpacking rows that overlap in a pixel unpack buffer works as expected.
TEST_P(Texture2DTestES3, UnpackOverlappingRowsFromUnpackBuffer)
{
- if (IsD3D11())
- {
- std::cout << "Test skipped on D3D." << std::endl;
- return;
- }
- if (IsOSX() && IsAMD())
- {
- // Incorrect rendering results seen on OSX AMD.
- std::cout << "Test skipped on OSX AMD." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsD3D11());
+
+ // Incorrect rendering results seen on OSX AMD.
+ ANGLE_SKIP_TEST_IF(IsOSX() && IsAMD());
const GLuint width = 8u;
const GLuint height = 8u;
@@ -3361,11 +3246,7 @@
// TODO(cwallez) this is failing on Intel Win7 OpenGL.
// TODO(zmo) this is faling on Win Intel HD 530 Debug.
// http://anglebugs.com/1706
- if (IsIntel() && IsWindows())
- {
- std::cout << "Test skipped on Win Intel." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsIntel() && IsWindows());
const int size = getWindowWidth();
diff --git a/src/tests/gl_tests/TimerQueriesTest.cpp b/src/tests/gl_tests/TimerQueriesTest.cpp
index 3250053..1e8d9d8 100644
--- a/src/tests/gl_tests/TimerQueriesTest.cpp
+++ b/src/tests/gl_tests/TimerQueriesTest.cpp
@@ -82,12 +82,7 @@
// Test that all proc addresses are loadable
TEST_P(TimerQueriesTest, ProcAddresses)
{
- if (!extensionEnabled("GL_EXT_disjoint_timer_query"))
- {
- std::cout << "Test skipped because GL_EXT_disjoint_timer_query is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_disjoint_timer_query"));
ASSERT_NE(nullptr, eglGetProcAddress("glGenQueriesEXT"));
ASSERT_NE(nullptr, eglGetProcAddress("glDeleteQueriesEXT"));
@@ -105,12 +100,7 @@
// Tests the time elapsed query
TEST_P(TimerQueriesTest, TimeElapsed)
{
- if (!extensionEnabled("GL_EXT_disjoint_timer_query"))
- {
- std::cout << "Test skipped because GL_EXT_disjoint_timer_query is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_disjoint_timer_query"));
GLint queryTimeElapsedBits = 0;
glGetQueryivEXT(GL_TIME_ELAPSED_EXT, GL_QUERY_COUNTER_BITS_EXT, &queryTimeElapsedBits);
@@ -119,11 +109,7 @@
std::cout << "Time elapsed counter bits: " << queryTimeElapsedBits << std::endl;
// Skip test if the number of bits is 0
- if (queryTimeElapsedBits == 0)
- {
- std::cout << "Test skipped because of 0 counter bits" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!queryTimeElapsedBits);
glDepthMask(GL_TRUE);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
@@ -192,18 +178,9 @@
TEST_P(TimerQueriesTest, TimeElapsedTextureTest)
{
// OSX drivers don't seem to properly time non-draw calls so we skip the test on Mac
- if (IsOSX())
- {
- std::cout << "Test skipped on OSX" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOSX());
- if (!extensionEnabled("GL_EXT_disjoint_timer_query"))
- {
- std::cout << "Test skipped because GL_EXT_disjoint_timer_query is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_disjoint_timer_query"));
GLint queryTimeElapsedBits = 0;
glGetQueryivEXT(GL_TIME_ELAPSED_EXT, GL_QUERY_COUNTER_BITS_EXT, &queryTimeElapsedBits);
@@ -212,11 +189,7 @@
std::cout << "Time elapsed counter bits: " << queryTimeElapsedBits << std::endl;
// Skip test if the number of bits is 0
- if (queryTimeElapsedBits == 0)
- {
- std::cout << "Test skipped because of 0 counter bits" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!queryTimeElapsedBits);
GLubyte pixels[] = {0, 0, 0, 255, 255, 255, 255, 255, 255, 0, 0, 0};
@@ -260,12 +233,7 @@
// Tests validation of query functions with respect to elapsed time query
TEST_P(TimerQueriesTest, TimeElapsedValidationTest)
{
- if (!extensionEnabled("GL_EXT_disjoint_timer_query"))
- {
- std::cout << "Test skipped because GL_EXT_disjoint_timer_query is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_disjoint_timer_query"));
GLint queryTimeElapsedBits = 0;
glGetQueryivEXT(GL_TIME_ELAPSED_EXT, GL_QUERY_COUNTER_BITS_EXT, &queryTimeElapsedBits);
@@ -274,11 +242,7 @@
std::cout << "Time elapsed counter bits: " << queryTimeElapsedBits << std::endl;
// Skip test if the number of bits is 0
- if (queryTimeElapsedBits == 0)
- {
- std::cout << "Test skipped because of 0 counter bits" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!queryTimeElapsedBits);
GLuint query = 0;
glGenQueriesEXT(-1, &query);
@@ -312,20 +276,11 @@
// Tests timer queries operating under multiple EGL contexts with mid-query switching
TEST_P(TimerQueriesTest, TimeElapsedMulticontextTest)
{
- if (IsAMD() && IsOpenGL())
- {
- // TODO(jmadill): Figure out why this test is flaky on AMD/OpenGL.
- // http://anglebug.com/1541
- std::cout << "Test skipped on AMD OpenGL." << std::endl;
- return;
- }
+ // TODO(jmadill): Figure out why this test is flaky on AMD/OpenGL.
+ // http://anglebug.com/1541
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL());
- if (!extensionEnabled("GL_EXT_disjoint_timer_query"))
- {
- std::cout << "Test skipped because GL_EXT_disjoint_timer_query is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_disjoint_timer_query"));
GLint queryTimeElapsedBits = 0;
glGetQueryivEXT(GL_TIME_ELAPSED_EXT, GL_QUERY_COUNTER_BITS_EXT, &queryTimeElapsedBits);
@@ -334,11 +289,7 @@
std::cout << "Time elapsed counter bits: " << queryTimeElapsedBits << std::endl;
// Skip test if the number of bits is 0
- if (queryTimeElapsedBits == 0)
- {
- std::cout << "Test skipped because of 0 counter bits" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!queryTimeElapsedBits);
// Without a glClear, the first draw call on GL takes a huge amount of time when run after the
// D3D test on certain NVIDIA drivers
@@ -473,12 +424,7 @@
// Tests GPU timestamp functionality
TEST_P(TimerQueriesTest, Timestamp)
{
- if (!extensionEnabled("GL_EXT_disjoint_timer_query"))
- {
- std::cout << "Test skipped because GL_EXT_disjoint_timer_query is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_disjoint_timer_query"));
GLint queryTimestampBits = 0;
glGetQueryivEXT(GL_TIMESTAMP_EXT, GL_QUERY_COUNTER_BITS_EXT, &queryTimestampBits);
@@ -487,11 +433,7 @@
std::cout << "Timestamp counter bits: " << queryTimestampBits << std::endl;
// Macs for some reason return 0 bits so skip the test for now if either are 0
- if (queryTimestampBits == 0)
- {
- std::cout << "Test skipped because of 0 counter bits" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!queryTimestampBits);
glDepthMask(GL_TRUE);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
@@ -548,12 +490,7 @@
// Tests getting timestamps via glGetInteger64v
TEST_P(TimerQueriesTestES3, TimestampGetInteger64)
{
- if (!extensionEnabled("GL_EXT_disjoint_timer_query"))
- {
- std::cout << "Test skipped because GL_EXT_disjoint_timer_query is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_disjoint_timer_query"));
GLint queryTimestampBits = 0;
glGetQueryivEXT(GL_TIMESTAMP_EXT, GL_QUERY_COUNTER_BITS_EXT, &queryTimestampBits);
@@ -561,11 +498,7 @@
std::cout << "Timestamp counter bits: " << queryTimestampBits << std::endl;
- if (queryTimestampBits == 0)
- {
- std::cout << "Test skipped because of 0 counter bits" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!queryTimestampBits);
glDepthMask(GL_TRUE);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
diff --git a/src/tests/gl_tests/TransformFeedbackTest.cpp b/src/tests/gl_tests/TransformFeedbackTest.cpp
index fc8ee1b..cb7aa18 100644
--- a/src/tests/gl_tests/TransformFeedbackTest.cpp
+++ b/src/tests/gl_tests/TransformFeedbackTest.cpp
@@ -500,11 +500,7 @@
{
ANGLE_SKIP_TEST_IF(IsOSX() && (IsNVIDIA() || IsAMD()) && IsOpenGL());
- if (IsLinux() && IsAMD() && IsOpenGL())
- {
- std::cout << "Test skipped on AMD OpenGL on Linux." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsLinux() && IsAMD() && IsOpenGL());
EGLint contextAttributes[] = {
EGL_CONTEXT_MAJOR_VERSION_KHR,
@@ -873,17 +869,9 @@
// glBeginTransformFeedback is called
TEST_P(TransformFeedbackTest, OffsetResetOnBeginTransformFeedback)
{
- if (IsOSX() && IsAMD())
- {
- std::cout << "Test skipped on Mac AMD." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOSX() && IsAMD());
- if (IsAndroid())
- {
- std::cout << "Test skipped on Android." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAndroid());
const std::string &vertexShaderSource =
"#version 300 es\n"
diff --git a/src/tests/gl_tests/UniformTest.cpp b/src/tests/gl_tests/UniformTest.cpp
index 4206852..76a57cb 100644
--- a/src/tests/gl_tests/UniformTest.cpp
+++ b/src/tests/gl_tests/UniformTest.cpp
@@ -605,11 +605,8 @@
int maxVertexTextureImageUnits = 0;
glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &maxVertexTextureImageUnits);
- if (maxVertexTextureImageUnits == 0)
- {
- std::cout << "Renderer doesn't support vertex texture fetch, skipping test" << std::endl;
- return;
- }
+ // Renderer doesn't support vertex texture fetch, skipping test.
+ ANGLE_SKIP_TEST_IF(!maxVertexTextureImageUnits);
const std::string &vertShader =
"attribute vec2 position;\n"
diff --git a/src/tests/gl_tests/VertexAttributeTest.cpp b/src/tests/gl_tests/VertexAttributeTest.cpp
index 3de11a3..49e803c 100644
--- a/src/tests/gl_tests/VertexAttributeTest.cpp
+++ b/src/tests/gl_tests/VertexAttributeTest.cpp
@@ -163,11 +163,7 @@
void runTest(const TestData &test, bool checkPixelEqual)
{
// TODO(geofflang): Figure out why this is broken on AMD OpenGL
- if (IsAMD() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
- {
- std::cout << "Test skipped on AMD OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL());
for (GLint i = 0; i < 4; i++)
{
@@ -723,11 +719,7 @@
TEST_P(VertexAttributeTest, MaxAttribsPlusOne)
{
// TODO(jmadill): Figure out why we get this error on AMD/ES2/OpenGL
- if (IsAMD() && GetParam() == ES2_OPENGL())
- {
- std::cout << "Test disabled on AMD/ES2/OpenGL" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && GetParam() == ES2_OPENGL());
GLint maxAttribs;
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttribs);
@@ -774,12 +766,8 @@
// Verify that index draw with an out-of-range offset generates INVALID_OPERATION.
TEST_P(VertexAttributeTest, DrawElementsBufferTooSmall)
{
- if (extensionEnabled("GL_KHR_robust_buffer_access_behavior"))
- {
- std::cout << "Test skipped due to supporting GL_KHR_robust_buffer_access_behavior"
- << std::endl;
- return;
- }
+ // Test skipped due to supporting GL_KHR_robust_buffer_access_behavior
+ ANGLE_SKIP_TEST_IF(extensionEnabled("GL_KHR_robust_buffer_access_behavior"));
std::array<GLfloat, kVertexCount> inputData;
std::array<GLfloat, kVertexCount> expectedData;
@@ -797,18 +785,10 @@
TEST_P(VertexAttributeTest, DrawArraysWithBufferOffset)
{
// TODO(jmadill): Diagnose this failure.
- if (IsD3D11_FL93())
- {
- std::cout << "Test disabled on D3D11 FL 9_3" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsD3D11_FL93());
// TODO(geofflang): Figure out why this is broken on AMD OpenGL
- if (IsAMD() && getPlatformRenderer() == EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE)
- {
- std::cout << "Test skipped on AMD OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsOpenGL());
initBasicProgram();
glUseProgram(mProgram);
@@ -1366,11 +1346,7 @@
// to stress-test the caching code.
TEST_P(VertexAttributeCachingTest, BufferMulticaching)
{
- if (IsAMD() && IsDesktopOpenGL())
- {
- std::cout << "Test skipped on AMD OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsDesktopOpenGL());
initBasicProgram();
@@ -1404,11 +1380,7 @@
// after enough iterations. It validates the unchanged attributes don't get deleted incidentally.
TEST_P(VertexAttributeCachingTest, BufferMulticachingWithOneUnchangedAttrib)
{
- if (IsAMD() && IsDesktopOpenGL())
- {
- std::cout << "Test skipped on AMD OpenGL." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsAMD() && IsDesktopOpenGL());
initDoubleAttribProgram();
diff --git a/src/tests/gl_tests/WebGLCompatibilityTest.cpp b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
index dd6199e..b797028 100644
--- a/src/tests/gl_tests/WebGLCompatibilityTest.cpp
+++ b/src/tests/gl_tests/WebGLCompatibilityTest.cpp
@@ -2161,11 +2161,8 @@
GLint maxDrawBuffers = 0;
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
- if (maxDrawBuffers < 2)
- {
- std::cout << "Test skipped because MAX_DRAW_BUFFERS is too small." << std::endl;
- return;
- }
+ // Test skipped because MAX_DRAW_BUFFERS is too small.
+ ANGLE_SKIP_TEST_IF(maxDrawBuffers < 2);
ANGLE_GL_PROGRAM(program, vertexShader, fragmentShader);
glUseProgram(program.get());
@@ -2334,12 +2331,7 @@
glRequestExtensionANGLE("GL_EXT_texture_compression_dxt1");
}
- if (!extensionEnabled("GL_EXT_texture_compression_dxt1"))
- {
- std::cout << "Test skipped because GL_EXT_texture_compression_dxt1 is not available."
- << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_EXT_texture_compression_dxt1"));
constexpr uint8_t CompressedImageDXT1[] = {0x00, 0xf8, 0x00, 0xf8, 0xaa, 0xaa, 0xaa, 0xaa};
@@ -2594,11 +2586,7 @@
TEST_P(WebGLCompatibilityTest, RGB32FTextures)
{
- if (IsLinux() && IsIntel())
- {
- std::cout << "Test skipped on Linux Intel." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsLinux() && IsIntel());
constexpr float data[] = {1000.0f, -500.0f, 10.0f, 1.0f};
@@ -2769,11 +2757,7 @@
TEST_P(WebGLCompatibilityTest, RGB16FTextures)
{
- if (IsOzone() && IsIntel())
- {
- std::cout << "Test skipped on Intel Ozone." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOzone() && IsIntel());
constexpr float readPixelsData[] = {7000.0f, 100.0f, 33.0f, 1.0f};
const GLushort textureData[] = {
@@ -2822,11 +2806,7 @@
TEST_P(WebGLCompatibilityTest, RGBA16FTextures)
{
- if (IsOzone() && IsIntel())
- {
- std::cout << "Test skipped on Intel Ozone." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(IsOzone() && IsIntel());
constexpr float readPixelsData[] = {7000.0f, 100.0f, 33.0f, -1.0f};
const GLushort textureData[] = {
@@ -2879,17 +2859,11 @@
// accepted by glTexImage2D
TEST_P(WebGLCompatibilityTest, SizedRGBA32FFormats)
{
- if (getClientMajorVersion() != 2)
- {
- std::cout << "Test skipped because it is only valid for WebGL1 contexts." << std::endl;
- return;
- }
+ // Test skipped because it is only valid for WebGL1 contexts.
+ ANGLE_SKIP_TEST_IF(getClientMajorVersion() != 2);
- if (!extensionRequestable("GL_OES_texture_float"))
- {
- std::cout << "Test skipped because GL_OES_texture_float is not requestable." << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionRequestable("GL_OES_texture_float"));
+
glRequestExtensionANGLE("GL_OES_texture_float");
ASSERT_GL_NO_ERROR();
@@ -3213,11 +3187,8 @@
// the buffer type.
TEST_P(WebGL2CompatibilityTest, ClearBufferTypeCompatibity)
{
- if (IsD3D11())
- {
- std::cout << "Test skipped because it generates D3D11 runtime warnings." << std::endl;
- return;
- }
+ // Test skipped for D3D11 because it generates D3D11 runtime warnings.
+ ANGLE_SKIP_TEST_IF(IsD3D11());
constexpr float clearFloat[] = {0.0f, 0.0f, 0.0f, 0.0f};
constexpr int clearInt[] = {0, 0, 0, 0};
@@ -3581,11 +3552,7 @@
bool useEXT = false;
if (getClientMajorVersion() < 3)
{
- if (!extensionRequestable("GL_EXT_draw_buffers"))
- {
- std::cout << "Test skipped because draw buffers are not available" << std::endl;
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionRequestable("GL_EXT_draw_buffers"));
glRequestExtensionANGLE("GL_EXT_draw_buffers");
useEXT = true;
@@ -3594,11 +3561,8 @@
GLint maxDrawBuffers = 0;
glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers);
- if (maxDrawBuffers < 4)
- {
- std::cout << "Test skipped because MAX_DRAW_BUFFERS is too small." << std::endl;
- return;
- }
+ // Test skipped because MAX_DRAW_BUFFERS is too small.
+ ANGLE_SKIP_TEST_IF(maxDrawBuffers < 4);
// Clears all the renderbuffers to red.
auto ClearEverythingToRed = [](GLRenderbuffer *renderbuffers) {
diff --git a/src/tests/gl_tests/WebGLFramebufferTest.cpp b/src/tests/gl_tests/WebGLFramebufferTest.cpp
index 3df70e1..4a3bce7 100644
--- a/src/tests/gl_tests/WebGLFramebufferTest.cpp
+++ b/src/tests/gl_tests/WebGLFramebufferTest.cpp
@@ -851,11 +851,7 @@
glRequestExtensionANGLE("GL_ANGLE_depth_texture");
}
- if (!extensionEnabled("GL_ANGLE_depth_texture"))
- {
- std::cout << "Test skipped because depth textures are not available.\n";
- return;
- }
+ ANGLE_SKIP_TEST_IF(!extensionEnabled("GL_ANGLE_depth_texture"));
GLTexture depthTexture;
glBindTexture(GL_TEXTURE_2D, depthTexture.get());
diff --git a/src/tests/gl_tests/WebGLReadOutsideFramebufferTest.cpp b/src/tests/gl_tests/WebGLReadOutsideFramebufferTest.cpp
index e8627d2..8206e51 100644
--- a/src/tests/gl_tests/WebGLReadOutsideFramebufferTest.cpp
+++ b/src/tests/gl_tests/WebGLReadOutsideFramebufferTest.cpp
@@ -363,11 +363,8 @@
#ifdef _WIN64
// TODO(fjhenigman): Figure out this failure.
- if (GetParam() == ES2_D3D11_FL9_3())
- {
- std::cout << "Cube map skipped on 64-bit " << GetParam() << "." << std::endl;
- return;
- }
+ // Cube map skipped on 64-bit Windows with D3D FL 9.3
+ ANGLE_SKIP_TEST_IF(GetParam() == ES2_D3D11_FL9_3());
#endif
Main2D(&WebGLReadOutsideFramebufferTest::TestCopyTexSubImageCube, false);
@@ -380,11 +377,8 @@
#ifdef _WIN64
// TODO(fjhenigman): Figure out this failure.
- if (GetParam() == ES2_D3D11_FL9_3())
- {
- std::cout << "Cube map skipped on 64-bit " << GetParam() << "." << std::endl;
- return;
- }
+ // Cube map skipped on 64-bit Windows with D3D FL 9.3
+ ANGLE_SKIP_TEST_IF(GetParam() == ES2_D3D11_FL9_3());
#endif
Main2D(&WebGLReadOutsideFramebufferTest::TestCopyTexImageCube, true);
@@ -394,12 +388,8 @@
// the corresponding source pixel is outside the framebuffer.
TEST_P(WebGL2ReadOutsideFramebufferTest, CopyTexSubImage3D)
{
- if (IsDesktopOpenGL() || IsOpenGLES())
- {
- std::cout << "Robust CopyTexSubImage3D behaviour is not implemented on OpenGL."
- << std::endl;
- return;
- }
+ // Robust CopyTexSubImage3D behaviour is not implemented on OpenGL.
+ ANGLE_SKIP_TEST_IF(IsDesktopOpenGL() || IsOpenGLES());
Main3D(&WebGLReadOutsideFramebufferTest::TestCopyTexSubImage3D, false);
}