Commit 2609bf4c by Kenneth Russell

Refactored test targets into angle_unittests and angle_end2end_tests.

angle_unittests subsumes the previous: angle_compiler_tests angle_preprocessor_tests and will subsume angle_implementation_unit_tests in a follow-on CL. angle_end2end_tests subsumes the previous: angle_tests angle_standalone_tests angle_implementation_unit_tests The bulk of these two targets have been factored into their own .gypi files, so that a different main.cpp can be trivially plugged in for the gtest harness. This refactoring has been tested both in ANGLE standalone builds, and builds within Chromium. BUG=chromium:435726 Change-Id: I231a3c1989c17e188cc469dcf80fe78b052afe78 Reviewed-on: https://chromium-review.googlesource.com/236681Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarKenneth Russell <kbr@chromium.org>
parent 54bd5a46
# 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)/tests/angle_tests/ANGLETest.cpp',
'<(angle_path)/tests/angle_tests/ANGLETest.h',
'<(angle_path)/tests/angle_tests/BlendMinMaxTest.cpp',
'<(angle_path)/tests/angle_tests/BlitFramebufferANGLETest.cpp',
'<(angle_path)/tests/angle_tests/BufferDataTest.cpp',
'<(angle_path)/tests/angle_tests/ClearTest.cpp',
'<(angle_path)/tests/angle_tests/CompressedTextureTest.cpp',
'<(angle_path)/tests/angle_tests/DepthStencilFormatsTest.cpp',
'<(angle_path)/tests/angle_tests/DrawBuffersTest.cpp',
'<(angle_path)/tests/angle_tests/FramebufferFormatsTest.cpp',
'<(angle_path)/tests/angle_tests/GLSLTest.cpp',
'<(angle_path)/tests/angle_tests/IncompleteTextureTest.cpp',
'<(angle_path)/tests/angle_tests/IndexedPointsTest.cpp',
'<(angle_path)/tests/angle_tests/LineLoopTest.cpp',
'<(angle_path)/tests/angle_tests/MaxTextureSizeTest.cpp',
'<(angle_path)/tests/angle_tests/media/pixel.inl',
'<(angle_path)/tests/angle_tests/OcclusionQueriesTest.cpp',
'<(angle_path)/tests/angle_tests/PBOExtensionTest.cpp',
'<(angle_path)/tests/angle_tests/ProgramBinaryTest.cpp',
'<(angle_path)/tests/angle_tests/ReadPixelsTest.cpp',
'<(angle_path)/tests/angle_tests/RendererTest.cpp',
'<(angle_path)/tests/angle_tests/SRGBTextureTest.cpp',
'<(angle_path)/tests/angle_tests/SwizzleTest.cpp',
'<(angle_path)/tests/angle_tests/TextureTest.cpp',
'<(angle_path)/tests/angle_tests/TransformFeedbackTest.cpp',
'<(angle_path)/tests/angle_tests/UniformTest.cpp',
'<(angle_path)/tests/angle_tests/UnpackAlignmentTest.cpp',
'<(angle_path)/tests/angle_tests/VertexAttributeTest.cpp',
'<(angle_path)/tests/standalone_tests/EGLThreadTest.cpp',
],
},
'dependencies':
[
'<(angle_path)/src/angle.gyp:libANGLE',
'<(angle_path)/src/angle.gyp:libEGL',
'<(angle_path)/src/angle.gyp:libGLESv2',
'<(angle_path)/tests/tests.gyp:angle_test_support',
'<(angle_path)/util/util.gyp:angle_util',
],
'include_dirs':
[
'../include',
'angle_tests',
],
'includes':
[
# TODO(kbr): move these to angle_unittests.gypi.
'angle_implementation_unit_tests/angle_implementation_unit_tests.gypi',
],
'sources':
[
'<@(angle_end2end_tests_sources)',
],
}
...@@ -10,4 +10,29 @@ ...@@ -10,4 +10,29 @@
'Surface_unittest.cpp', 'Surface_unittest.cpp',
'TransformFeedback_unittest.cpp' 'TransformFeedback_unittest.cpp'
], ],
'conditions':
[
['angle_build_winrt==1',
{
'sources':
[
'CoreWindowNativeWindow_unittest.cpp',
'SwapChainPanelNativeWindow_unittest.cpp',
],
'defines':
[
'ANGLE_ENABLE_D3D11',
],
'msvs_settings':
{
'VCLinkerTool':
{
'AdditionalDependencies':
[
'runtimeobject.lib',
],
},
},
}],
],
} }
//
// 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.
//
#include "gmock/gmock.h"
#include "gtest/gtest.h"
int main(int argc, char** argv)
{
testing::InitGoogleMock(&argc, argv);
int rt = RUN_ALL_TESTS();
return rt;
}
# 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)/tests/compiler_tests/API_test.cpp',
'<(angle_path)/tests/compiler_tests/CollectVariables_test.cpp',
'<(angle_path)/tests/compiler_tests/DebugShaderPrecision_test.cpp',
'<(angle_path)/tests/compiler_tests/ExpressionLimit_test.cpp',
'<(angle_path)/tests/compiler_tests/NV_draw_buffers_test.cpp',
'<(angle_path)/tests/compiler_tests/ShaderVariable_test.cpp',
'<(angle_path)/tests/compiler_tests/TypeTracking_test.cpp',
'<(angle_path)/tests/preprocessor_tests/char_test.cpp',
'<(angle_path)/tests/preprocessor_tests/comment_test.cpp',
'<(angle_path)/tests/preprocessor_tests/define_test.cpp',
'<(angle_path)/tests/preprocessor_tests/error_test.cpp',
'<(angle_path)/tests/preprocessor_tests/extension_test.cpp',
'<(angle_path)/tests/preprocessor_tests/identifier_test.cpp',
'<(angle_path)/tests/preprocessor_tests/if_test.cpp',
'<(angle_path)/tests/preprocessor_tests/input_test.cpp',
'<(angle_path)/tests/preprocessor_tests/location_test.cpp',
'<(angle_path)/tests/preprocessor_tests/MockDiagnostics.h',
'<(angle_path)/tests/preprocessor_tests/MockDirectiveHandler.h',
'<(angle_path)/tests/preprocessor_tests/number_test.cpp',
'<(angle_path)/tests/preprocessor_tests/operator_test.cpp',
'<(angle_path)/tests/preprocessor_tests/pragma_test.cpp',
'<(angle_path)/tests/preprocessor_tests/PreprocessorTest.cpp',
'<(angle_path)/tests/preprocessor_tests/PreprocessorTest.h',
'<(angle_path)/tests/preprocessor_tests/space_test.cpp',
'<(angle_path)/tests/preprocessor_tests/token_test.cpp',
'<(angle_path)/tests/preprocessor_tests/version_test.cpp',
],
},
'dependencies':
[
'<(angle_path)/src/angle.gyp:preprocessor',
'<(angle_path)/src/angle.gyp:translator_static',
'<(angle_path)/tests/tests.gyp:angle_test_support',
],
'include_dirs':
[
'../include',
'../src',
'../src/compiler/preprocessor',
],
'sources':
[
'<@(angle_unittests_sources)',
],
'msvs_settings':
{
'VCLinkerTool':
{
'conditions':
[
['angle_build_winrt==1',
{
'AdditionalDependencies':
[
'runtimeobject.lib',
],
}],
],
},
},
}
//
// Copyright (c) 2013 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.
//
#include "gmock/gmock.h"
#include "gtest/gtest.h"
int main(int argc, char** argv)
{
testing::InitGoogleMock(&argc, argv);
int rt = RUN_ALL_TESTS();
return rt;
}
...@@ -103,144 +103,75 @@ ...@@ -103,144 +103,75 @@
}], }],
], ],
}, },
],
'conditions':
[
['angle_standalone==1',
{ {
'target_name': 'angle_compiler_tests', # These same target names exist on the Chromium side,
'type': 'executable', # which is forbidden, so we make them conditional on
'dependencies': # ANGLE's standalone build.
[ 'targets':
'../src/angle.gyp:preprocessor',
'../src/angle.gyp:translator_static',
'angle_test_support',
],
'include_dirs':
[
'../include',
'../src',
'../src/compiler/preprocessor',
],
'includes':
[
'../build/common_defines.gypi',
'compiler_tests/compiler_tests.gypi',
'preprocessor_tests/preprocessor_tests.gypi',
],
'sources':
[ [
'compiler_tests/compiler_test_main.cpp',
],
'msvs_settings':
{
'VCLinkerTool':
{ {
'conditions': 'target_name': 'angle_unittests',
'type': 'executable',
'includes':
[
'../build/common_defines.gypi',
'angle_unittests.gypi',
],
'sources':
[ [
['angle_build_winrt==1', 'angle_unittests_main.cpp',
],
'msvs_settings':
{
'VCLinkerTool':
{ {
'AdditionalDependencies': 'conditions':
[ [
'runtimeobject.lib', ['angle_build_winrt==1',
{
'AdditionalDependencies':
[
'runtimeobject.lib',
],
}],
], ],
}], },
], },
}, },
},
},
{
'target_name': 'angle_implementation_unit_tests',
'type': 'executable',
'dependencies':
[
'../src/angle.gyp:libANGLE',
'angle_test_support',
],
'include_dirs':
[
'../include',
'../src',
],
'includes':
[
'../build/common_defines.gypi',
'angle_implementation_unit_tests/angle_implementation_unit_tests.gypi',
],
'sources':
[
'angle_implementation_unit_tests/angle_implementation_unit_tests_main.cpp',
], ],
'conditions': 'conditions':
[ [
['angle_build_winrt==1', ['OS=="win"',
{ {
'sources': 'targets':
[
'angle_implementation_unit_tests/CoreWindowNativeWindow_unittest.cpp',
'angle_implementation_unit_tests/SwapChainPanelNativeWindow_unittest.cpp',
],
'defines':
[ [
'ANGLE_ENABLE_D3D11',
],
'msvs_settings':
{
'VCLinkerTool':
{ {
'AdditionalDependencies': 'target_name': 'angle_end2end_tests',
'type': 'executable',
'includes':
[
'../build/common_defines.gypi',
'angle_end2end_tests.gypi',
],
'sources':
[ [
'runtimeobject.lib', 'angle_end2end_tests_main.cpp',
], ],
}, },
}, ],
}], }],
], ],
}, }],
],
'conditions':
[
['OS=="win"', ['OS=="win"',
{ {
'targets': 'targets':
[ [
{ {
'target_name': 'angle_end2end_tests',
'type': 'executable',
'includes': [ '../build/common_defines.gypi', ],
'dependencies':
[
'../src/angle.gyp:libGLESv2',
'../src/angle.gyp:libEGL',
'../util/util.gyp:angle_util',
'angle_test_support',
],
'include_dirs':
[
'../include',
'angle_tests',
],
'sources':
[
'<!@(python <(angle_path)/enumerate_files.py angle_tests -types *.cpp *.h *.inl)'
],
},
{
'target_name': 'angle_standalone_tests',
'type': 'executable',
'includes': [ '../build/common_defines.gypi', ],
'dependencies':
[
'angle_test_support',
],
'include_dirs':
[
'../include',
'angle_tests',
],
'sources':
[
'<!@(python <(angle_path)/enumerate_files.py standalone_tests -types *.cpp *.h)'
],
},
{
'target_name': 'angle_perf_tests', 'target_name': 'angle_perf_tests',
'type': 'executable', 'type': 'executable',
'includes': [ '../build/common_defines.gypi', ], 'includes': [ '../build/common_defines.gypi', ],
......
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