Commit 559a2e8c by Jamie Madill

Move the ANGLE tests project to src/

*re-re-land with fix for Chrome's angle tests* BUG=angleproject:945 Change-Id: I3c64e2edc776c299791440f65f22450855eb6dfa Reviewed-on: https://chromium-review.googlesource.com/260448Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 96e3f556
......@@ -22,12 +22,12 @@ debug.txt
*.rej
.gclient_entries
/third_party
/tests/third_party/googlemock
/tests/third_party/googletest
/tests/third_party/libpng
/tests/third_party/zlib
/tests/third_party/deqp
/tests/third_party/gles_conformance_tests
/src/tests/third_party/googlemock
/src/tests/third_party/googletest
/src/tests/third_party/libpng
/src/tests/third_party/zlib
/src/tests/third_party/deqp
/src/tests/third_party/gles_conformance_tests
out
lib/*
Makefile
......
......@@ -4,10 +4,10 @@ deps = {
# TODO(kbr): figure out how to better stay in sync with Chromium's
# versions of googletest and googlemock.
"tests/third_party/googletest":
"src/tests/third_party/googletest":
"http://googletest.googlecode.com/svn/trunk@629",
"tests/third_party/googlemock":
"src/tests/third_party/googlemock":
"http://googlemock.googlecode.com/svn/trunk@410",
}
......
......@@ -6,7 +6,7 @@
'targets':
[
{
'target_name': 'All',
'target_name': 'all',
'type': 'none',
'dependencies':
[
......@@ -21,7 +21,7 @@
'dependencies':
[
'../samples/samples.gyp:*',
'../tests/tests.gyp:*',
'../src/tests/tests.gyp:*',
],
}],
],
......
......@@ -6,6 +6,7 @@
'includes': [ 'common_defines.gypi', ],
'variables':
{
'angle_path%': '<(DEPTH)',
'angle_build_winrt%': '0',
'angle_build_winphone%': '0',
# angle_code is set to 1 for the core ANGLE targets defined in src/build_angle.gyp.
......@@ -115,14 +116,14 @@
# Windows Application Store requirements
# The C runtime for Windows Store applications
# is a framework package that is managed by
# is a framework package that is managed by
# the Windows deployment model and can be
# shared by multiple packages.
'RuntimeLibrary': '3', # /MDd (debug dll)
},
{
# Use the static C runtime to
# Use the static C runtime to
# match chromium and make sure
# we don't depend on the dynamic
# runtime's shared heaps
......@@ -174,13 +175,13 @@
# Windows Application Store requirements
# The C runtime for Windows Store applications
# is a framework package that is managed by
# is a framework package that is managed by
# the Windows deployment model and can be
# shared by multiple packages.
'RuntimeLibrary': '2', # /MD (nondebug dll)
},
{
# Use the static C runtime to
# Use the static C runtime to
# match chromium and make sure
# we don't depend on the dynamic
'RuntimeLibrary': '0', # /MT (nondebug static)
......
......@@ -6,7 +6,6 @@
'variables':
{
'component%': 'static_library',
'angle_path%': '..',
'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/8.1',
'angle_build_winrt%': '0',
'angle_build_winphone%': '0',
......
......@@ -33,5 +33,5 @@ if __name__ == '__main__':
# a Chromium workspace).
args.append('-Dangle_standalone=1')
# Add all.gyp as the main gyp file to be generated.
args.append(os.path.join(script_dir, 'all.gyp'))
args.append(os.path.join(script_dir, 'ANGLE.gyp'))
sys.exit(gyp.main(args))
# Copyright (c) 2014 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.
# This .gypi describes all of the sources and dependencies to build a
# unified "angle_end2end_tests" target, which contains all of the
# tests that exercise the ANGLE implementation. It requires a parent
# target to include this gypi in an executable target containing a
# gtest harness in a main.cpp.
{
'variables':
{
# This file list will be shared with the GN build.
'angle_end2end_tests_sources':
[
'<(angle_path)/src/tests/end2end_tests/ANGLETest.cpp',
'<(angle_path)/src/tests/end2end_tests/ANGLETest.h',
'<(angle_path)/src/tests/end2end_tests/BindTexImageTest.cpp',
'<(angle_path)/src/tests/end2end_tests/BlendMinMaxTest.cpp',
'<(angle_path)/src/tests/end2end_tests/BlitFramebufferANGLETest.cpp',
'<(angle_path)/src/tests/end2end_tests/BufferDataTest.cpp',
'<(angle_path)/src/tests/end2end_tests/ClearTest.cpp',
'<(angle_path)/src/tests/end2end_tests/CompressedTextureTest.cpp',
'<(angle_path)/src/tests/end2end_tests/CubeMapTextureTest.cpp',
'<(angle_path)/src/tests/end2end_tests/DepthStencilFormatsTest.cpp',
'<(angle_path)/src/tests/end2end_tests/DrawBuffersTest.cpp',
'<(angle_path)/src/tests/end2end_tests/FramebufferFormatsTest.cpp',
'<(angle_path)/src/tests/end2end_tests/GLSLTest.cpp',
'<(angle_path)/src/tests/end2end_tests/IncompleteTextureTest.cpp',
'<(angle_path)/src/tests/end2end_tests/IndexedPointsTest.cpp',
'<(angle_path)/src/tests/end2end_tests/InstancingTest.cpp',
'<(angle_path)/src/tests/end2end_tests/LineLoopTest.cpp',
'<(angle_path)/src/tests/end2end_tests/MaxTextureSizeTest.cpp',
'<(angle_path)/src/tests/end2end_tests/MipmapTest.cpp',
'<(angle_path)/src/tests/end2end_tests/media/pixel.inl',
'<(angle_path)/src/tests/end2end_tests/OcclusionQueriesTest.cpp',
'<(angle_path)/src/tests/end2end_tests/PBOExtensionTest.cpp',
'<(angle_path)/src/tests/end2end_tests/PointSpritesTest.cpp',
'<(angle_path)/src/tests/end2end_tests/ProgramBinaryTest.cpp',
'<(angle_path)/src/tests/end2end_tests/ReadPixelsTest.cpp',
'<(angle_path)/src/tests/end2end_tests/RendererTest.cpp',
'<(angle_path)/src/tests/end2end_tests/SimpleOperationTest.cpp',
'<(angle_path)/src/tests/end2end_tests/SRGBTextureTest.cpp',
'<(angle_path)/src/tests/end2end_tests/SwizzleTest.cpp',
'<(angle_path)/src/tests/end2end_tests/TextureTest.cpp',
'<(angle_path)/src/tests/end2end_tests/TransformFeedbackTest.cpp',
'<(angle_path)/src/tests/end2end_tests/UniformTest.cpp',
'<(angle_path)/src/tests/end2end_tests/UnpackAlignmentTest.cpp',
'<(angle_path)/src/tests/end2end_tests/UnpackRowLength.cpp',
'<(angle_path)/src/tests/end2end_tests/VertexAttributeTest.cpp',
'<(angle_path)/src/tests/end2end_tests/ViewportTest.cpp',
'<(angle_path)/src/tests/standalone_tests/EGLThreadTest.cpp',
'<(angle_path)/src/tests/standalone_tests/EGLQueryContextTest.cpp',
],
},
'dependencies':
[
'<(angle_path)/src/angle.gyp:libEGL',
'<(angle_path)/src/angle.gyp:libGLESv2',
'<(angle_path)/src/tests/tests.gyp:angle_test_support',
'<(angle_path)/util/util.gyp:angle_util',
],
'include_dirs':
[
'<(angle_path)/include',
'end2end_tests',
],
'sources':
[
'<@(angle_end2end_tests_sources)',
],
}
# Copyright (c) 2014 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.
# This .gypi describes all of the sources and dependencies to build a
# unified "angle_unittests" target, which contains all of ANGLE's
# tests that don't require a fully functional ANGLE in order to run
# (compiler tests, preprocessor tests, etc.). It requires a parent
# target to include this gypi in an executable target containing a
# gtest harness in a main.cpp.
{
'variables':
{
# This file list will be shared with the GN build.
'angle_unittests_sources':
[
'<(angle_path)/src/libANGLE/Config_unittest.cpp',
'<(angle_path)/src/libANGLE/Fence_unittest.cpp',
'<(angle_path)/src/libANGLE/ImageIndexIterator_unittest.cpp',
'<(angle_path)/src/libANGLE/Surface_unittest.cpp',
'<(angle_path)/src/libANGLE/TransformFeedback_unittest.cpp',
'<(angle_path)/src/tests/compiler_tests/API_test.cpp',
'<(angle_path)/src/tests/compiler_tests/CollectVariables_test.cpp',
'<(angle_path)/src/tests/compiler_tests/ConstantFolding_test.cpp',
'<(angle_path)/src/tests/compiler_tests/DebugShaderPrecision_test.cpp',
'<(angle_path)/src/tests/compiler_tests/ExpressionLimit_test.cpp',
'<(angle_path)/src/tests/compiler_tests/ShaderExtension_test.cpp',
'<(angle_path)/src/tests/compiler_tests/NV_draw_buffers_test.cpp',
'<(angle_path)/src/tests/compiler_tests/ShaderVariable_test.cpp',
'<(angle_path)/src/tests/compiler_tests/TypeTracking_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/char_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/comment_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/define_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/error_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/extension_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/identifier_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/if_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/input_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/location_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/MockDiagnostics.h',
'<(angle_path)/src/tests/preprocessor_tests/MockDirectiveHandler.h',
'<(angle_path)/src/tests/preprocessor_tests/number_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/operator_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/pragma_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/PreprocessorTest.cpp',
'<(angle_path)/src/tests/preprocessor_tests/PreprocessorTest.h',
'<(angle_path)/src/tests/preprocessor_tests/space_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/token_test.cpp',
'<(angle_path)/src/tests/preprocessor_tests/version_test.cpp',
],
},
'dependencies':
[
'<(angle_path)/src/angle.gyp:libANGLE',
'<(angle_path)/src/angle.gyp:preprocessor',
'<(angle_path)/src/angle.gyp:translator_static',
'<(angle_path)/src/tests/tests.gyp:angle_test_support',
],
'include_dirs':
[
'<(angle_path)/include',
'<(angle_path)/src',
'<(angle_path)/src/compiler/preprocessor',
],
'sources':
[
'<@(angle_unittests_sources)',
],
'conditions':
[
['angle_build_winrt==1',
{
'sources':
[
'<(angle_path)/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow_unittest.cpp',
'<(angle_path)/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow_unittest.cpp',
],
'defines':
[
'ANGLE_ENABLE_D3D11',
],
'msvs_settings':
{
'VCLinkerTool':
{
'AdditionalDependencies':
[
'runtimeobject.lib',
],
},
},
}],
],
}
//
// 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"
#define GL_GLEXT_PROTOTYPES
#include "angle_gl.h"
#include <algorithm>
#include "shared_utils.h"
#include "shader_utils.h"
#include "testfixturetypes.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_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::Test
{
protected:
ANGLETest(EGLint glesMajorVersion, const EGLPlatformParameters &platform);
~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