Commit d3970de4 by Corentin Wallez

Move ANGLETest back in test_utils, leaving a proxy header for Chromium

BUG=angleproject:892 Change-Id: Ibd494813be87e996096077d6e208cc92461b8f49 Reviewed-on: https://chromium-review.googlesource.com/271154Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 1f67547b
......@@ -50,8 +50,8 @@
'<(angle_path)/src/tests/gl_tests/VertexAttributeTest.cpp',
'<(angle_path)/src/tests/gl_tests/ViewportTest.cpp',
'<(angle_path)/src/tests/egl_tests/EGLQueryContextTest.cpp',
'<(angle_path)/src/tests/end2end_tests/ANGLETest.cpp',
'<(angle_path)/src/tests/end2end_tests/ANGLETest.h',
'<(angle_path)/src/tests/test_utils/ANGLETest.cpp',
'<(angle_path)/src/tests/test_utils/ANGLETest.h',
'<(angle_path)/src/tests/test_utils/angle_test_configs.h',
],
'angle_end2end_tests_win_sources':
......
......@@ -5,7 +5,7 @@
//
#include "gtest/gtest.h"
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
int main(int argc, char** argv)
{
......
......@@ -13,7 +13,7 @@
#include "OSWindow.h"
#include "common/angleutils.h"
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
namespace
{
......
//
// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Proxy header for Chromium
// TODO(cwallez) remove this file once Chromium uses the new location of ANGLETest.h
#ifndef ANGLE_TESTS_ANGLE_TEST_H_
#define ANGLE_TESTS_ANGLE_TEST_H_
#include <gtest/gtest.h>
#include <algorithm>
#include "angle_gl.h"
#include "test_utils/angle_test_configs.h"
#include "common/angleutils.h"
#include "shader_utils.h"
#define EXPECT_GL_ERROR(err) EXPECT_EQ((err), glGetError())
#define EXPECT_GL_NO_ERROR() EXPECT_GL_ERROR(GL_NO_ERROR)
#define ASSERT_GL_ERROR(err) ASSERT_EQ((err), glGetError())
#define ASSERT_GL_NO_ERROR() ASSERT_GL_ERROR(GL_NO_ERROR)
#define EXPECT_EGL_ERROR(err) EXPECT_EQ((err), eglGetError())
#define EXPECT_EGL_SUCCESS() EXPECT_EGL_ERROR(EGL_SUCCESS)
#define ASSERT_EGL_ERROR(err) ASSERT_EQ((err), eglGetError())
#define ASSERT_EGL_SUCCESS() ASSERT_EGL_ERROR(EGL_SUCCESS)
#define EXPECT_PIXEL_EQ(x, y, r, g, b, a) \
{ \
GLubyte pixel[4]; \
glReadPixels((x), (y), 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel); \
EXPECT_GL_NO_ERROR(); \
EXPECT_EQ((r), pixel[0]); \
EXPECT_EQ((g), pixel[1]); \
EXPECT_EQ((b), pixel[2]); \
EXPECT_EQ((a), pixel[3]); \
}
#define EXPECT_PIXEL_NEAR(x, y, r, g, b, a, abs_error) \
{ \
GLubyte pixel[4]; \
glReadPixels((x), (y), 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel); \
EXPECT_GL_NO_ERROR(); \
EXPECT_NEAR((r), pixel[0], abs_error); \
EXPECT_NEAR((g), pixel[1], abs_error); \
EXPECT_NEAR((b), pixel[2], abs_error); \
EXPECT_NEAR((a), pixel[3], abs_error); \
}
class EGLWindow;
class OSWindow;
class ANGLETest : public ::testing::TestWithParam<angle::PlatformParameters>
{
protected:
ANGLETest();
~ANGLETest();
public:
static bool InitTestWindow();
static bool DestroyTestWindow();
static bool ResizeWindow(int width, int height);
static void SetWindowVisible(bool isVisible);
protected:
virtual void SetUp();
virtual void TearDown();
virtual void swapBuffers();
static void drawQuad(GLuint program, const std::string& positionAttribName, GLfloat quadDepth, GLfloat quadScale = 1.0f);
static GLuint compileShader(GLenum type, const std::string &source);
static bool extensionEnabled(const std::string &extName);
void setWindowWidth(int width);
void setWindowHeight(int height);
void setConfigRedBits(int bits);
void setConfigGreenBits(int bits);
void setConfigBlueBits(int bits);
void setConfigAlphaBits(int bits);
void setConfigDepthBits(int bits);
void setConfigStencilBits(int bits);
void setMultisampleEnabled(bool enabled);
int getClientVersion() const;
EGLWindow *getEGLWindow() const;
int getWindowWidth() const;
int getWindowHeight() const;
bool isMultisampleEnabled() const;
bool isIntel() const;
bool isAMD() const;
bool isNVidia() const;
EGLint getPlatformRenderer() const;
private:
bool createEGLContext();
bool destroyEGLContext();
EGLWindow *mEGLWindow;
static OSWindow *mOSWindow;
};
class ANGLETestEnvironment : public testing::Environment
{
public:
virtual void SetUp();
virtual void TearDown();
};
#endif // ANGLE_TESTS_ANGLE_TEST_H_
#include "../test_utils/ANGLETest.h"
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
#include <cstdint>
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
#include "media/pixel.inl"
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
#include "libANGLE/Context.h"
#include "libANGLE/Program.h"
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
#include <vector>
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
#include <array>
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
// Needed for Sleep()
#include <Windows.h>
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -6,7 +6,7 @@
// Some of the pointsprite tests below were ported from Khronos WebGL
// conformance test suite.
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
#include <memory>
#include <stdint.h>
......
......@@ -12,7 +12,7 @@
#define ANGLE_ENABLE_D3D11
#endif
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
#include "com_utils.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -8,7 +8,7 @@
// If one of these tests fails, then it is likely that some of the other tests are being configured incorrectly.
// For example, they might be using the D3D11 renderer when the test is meant to be using the D3D9 renderer.
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -6,7 +6,7 @@
// SimpleOperationTest:
// Basic GL commands such as linking a program, initializing a buffer, etc.
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
#include <vector>
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
#include <vector>
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
#include <array>
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
#include <array>
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
......@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
#include "end2end_tests/ANGLETest.h"
#include "test_utils/ANGLETest.h"
using namespace angle;
......
//
// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#ifndef ANGLE_TESTS_ANGLE_TEST_H_
#define ANGLE_TESTS_ANGLE_TEST_H_
#include <gtest/gtest.h>
#include <algorithm>
#include "angle_gl.h"
#include "angle_test_configs.h"
#include "common/angleutils.h"
#include "shader_utils.h"
#define EXPECT_GL_ERROR(err) EXPECT_EQ((err), glGetError())
#define EXPECT_GL_NO_ERROR() EXPECT_GL_ERROR(GL_NO_ERROR)
#define ASSERT_GL_ERROR(err) ASSERT_EQ((err), glGetError())
#define ASSERT_GL_NO_ERROR() ASSERT_GL_ERROR(GL_NO_ERROR)
#define EXPECT_EGL_ERROR(err) EXPECT_EQ((err), eglGetError())
#define EXPECT_EGL_SUCCESS() EXPECT_EGL_ERROR(EGL_SUCCESS)
#define ASSERT_EGL_ERROR(err) ASSERT_EQ((err), eglGetError())
#define ASSERT_EGL_SUCCESS() ASSERT_EGL_ERROR(EGL_SUCCESS)
#define EXPECT_PIXEL_EQ(x, y, r, g, b, a) \
{ \
GLubyte pixel[4]; \
glReadPixels((x), (y), 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel); \
EXPECT_GL_NO_ERROR(); \
EXPECT_EQ((r), pixel[0]); \
EXPECT_EQ((g), pixel[1]); \
EXPECT_EQ((b), pixel[2]); \
EXPECT_EQ((a), pixel[3]); \
}
#define EXPECT_PIXEL_NEAR(x, y, r, g, b, a, abs_error) \
{ \
GLubyte pixel[4]; \
glReadPixels((x), (y), 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel); \
EXPECT_GL_NO_ERROR(); \
EXPECT_NEAR((r), pixel[0], abs_error); \
EXPECT_NEAR((g), pixel[1], abs_error); \
EXPECT_NEAR((b), pixel[2], abs_error); \
EXPECT_NEAR((a), pixel[3], abs_error); \
}
class EGLWindow;
class OSWindow;
class ANGLETest : public ::testing::TestWithParam<angle::PlatformParameters>
{
protected:
ANGLETest();
~ANGLETest();
public:
static bool InitTestWindow();
static bool DestroyTestWindow();
static bool ResizeWindow(int width, int height);
static void SetWindowVisible(bool isVisible);
protected:
virtual void SetUp();
virtual void TearDown();
virtual void swapBuffers();
static void drawQuad(GLuint program, const std::string& positionAttribName, GLfloat quadDepth, GLfloat quadScale = 1.0f);
static GLuint compileShader(GLenum type, const std::string &source);
static bool extensionEnabled(const std::string &extName);
void setWindowWidth(int width);
void setWindowHeight(int height);
void setConfigRedBits(int bits);
void setConfigGreenBits(int bits);
void setConfigBlueBits(int bits);
void setConfigAlphaBits(int bits);
void setConfigDepthBits(int bits);
void setConfigStencilBits(int bits);
void setMultisampleEnabled(bool enabled);
int getClientVersion() const;
EGLWindow *getEGLWindow() const;
int getWindowWidth() const;
int getWindowHeight() const;
bool isMultisampleEnabled() const;
bool isIntel() const;
bool isAMD() const;
bool isNVidia() const;
EGLint getPlatformRenderer() const;
private:
bool createEGLContext();
bool destroyEGLContext();
EGLWindow *mEGLWindow;
static OSWindow *mOSWindow;
};
class ANGLETestEnvironment : public testing::Environment
{
public:
virtual void SetUp();
virtual void TearDown();
};
#endif // ANGLE_TESTS_ANGLE_TEST_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment