Commit 1027aa62 by Kenneth Russell

Refactor gmock and gtest dependencies for ANGLE's tests.

This change allows these targets to be referenced from Chromium's build projects. BUG=angleproject:833 Change-Id: I14694f610921d28ddcd8664887086ca30375b7a2 Reviewed-on: https://chromium-review.googlesource.com/231072Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Tested-by: 's avatarKenneth Russell <kbr@chromium.org>
parent f8fccb39
...@@ -2,6 +2,8 @@ deps = { ...@@ -2,6 +2,8 @@ deps = {
"third_party/gyp": "third_party/gyp":
"http://gyp.googlecode.com/svn/trunk@1987", "http://gyp.googlecode.com/svn/trunk@1987",
# TODO(kbr): figure out how to better stay in sync with Chromium's
# versions of googletest and googlemock.
"tests/third_party/googletest": "tests/third_party/googletest":
"http://googletest.googlecode.com/svn/trunk@629", "http://googletest.googlecode.com/svn/trunk@629",
......
...@@ -29,6 +29,9 @@ if __name__ == '__main__': ...@@ -29,6 +29,9 @@ if __name__ == '__main__':
# Add common.gypi to the include path. # Add common.gypi to the include path.
args.append('-I' + os.path.join(script_dir, 'common.gypi')) args.append('-I' + os.path.join(script_dir, 'common.gypi'))
args.append('--no-parallel') args.append('--no-parallel')
# Indicate ANGLE is being built standalone (as opposed to within
# a Chromium workspace).
args.append('-Dangle_standalone=1')
# Add all.gyp as the main gyp file to be generated. # 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, 'all.gyp'))
sys.exit(gyp.main(args)) sys.exit(gyp.main(args))
...@@ -26,6 +26,7 @@ def generateProjects(generation_dir, build_winphone): ...@@ -26,6 +26,7 @@ def generateProjects(generation_dir, build_winphone):
gyp_cmd += ' -D angle_build_winrt=1' gyp_cmd += ' -D angle_build_winrt=1'
gyp_cmd += ' -D angle_build_winphone=' + ('1' if build_winphone else '0') gyp_cmd += ' -D angle_build_winphone=' + ('1' if build_winphone else '0')
gyp_cmd += ' -D angle_enable_d3d9=0' gyp_cmd += ' -D angle_enable_d3d9=0'
gyp_cmd += ' -D angle_standalone=1'
gyp_cmd += ' ' + os.path.join(script_dir, 'all.gyp') gyp_cmd += ' ' + os.path.join(script_dir, 'all.gyp')
print 'Generating projects to ' + generation_dir + ' from gyp files...' print 'Generating projects to ' + generation_dir + ' from gyp files...'
......
...@@ -7,11 +7,13 @@ ...@@ -7,11 +7,13 @@
{ {
'angle_build_conformance_tests%': '0', 'angle_build_conformance_tests%': '0',
'angle_build_deqp_tests%': '0', 'angle_build_deqp_tests%': '0',
# build/gyp_angle sets this to 1.
'angle_standalone%': 0,
}, },
'targets': 'targets':
[ [
{ {
'target_name': 'gtest', 'target_name': 'angle_internal_gtest',
'type': 'static_library', 'type': 'static_library',
'includes': [ '../build/common_defines.gypi', ], 'includes': [ '../build/common_defines.gypi', ],
'include_dirs': 'include_dirs':
...@@ -27,17 +29,22 @@ ...@@ -27,17 +29,22 @@
[ [
'_VARIADIC_MAX=10', '_VARIADIC_MAX=10',
], ],
'direct_dependent_settings': 'all_dependent_settings':
{ {
'defines': 'defines':
[ [
'_VARIADIC_MAX=10', '_VARIADIC_MAX=10',
], ],
'include_dirs':
[
'third_party/googletest',
'third_party/googletest/include',
],
}, },
}, },
{ {
'target_name': 'gmock', 'target_name': 'angle_internal_gmock',
'type': 'static_library', 'type': 'static_library',
'includes': [ '../build/common_defines.gypi', ], 'includes': [ '../build/common_defines.gypi', ],
'include_dirs': 'include_dirs':
...@@ -54,29 +61,59 @@ ...@@ -54,29 +61,59 @@
[ [
'_VARIADIC_MAX=10', '_VARIADIC_MAX=10',
], ],
'direct_dependent_settings': 'all_dependent_settings':
{ {
'defines': 'defines':
[ [
'_VARIADIC_MAX=10', '_VARIADIC_MAX=10',
], ],
'include_dirs':
[
'third_party/googlemock',
'third_party/googlemock/include',
'third_party/googletest/include',
],
}, },
}, },
{
'target_name': 'test_support',
'type': 'none',
'conditions':
[
['angle_standalone==1',
{
'dependencies': [
'angle_internal_gmock',
'angle_internal_gtest',
],
},
{
'dependencies': [
'<(DEPTH)/testing/gmock.gyp:gmock',
'<(DEPTH)/testing/gtest.gyp:gtest',
],
'all_dependent_settings':
{
'include_dirs':
[
'<(DEPTH)/testing/gmock/include',
'<(DEPTH)/testing/gtest/include',
],
},
}],
],
},
{ {
'target_name': 'preprocessor_tests', 'target_name': 'preprocessor_tests',
'type': 'executable', 'type': 'executable',
'dependencies': 'dependencies':
[ [
'../src/angle.gyp:preprocessor', '../src/angle.gyp:preprocessor',
'gtest', 'test_support',
'gmock',
], ],
'include_dirs': 'include_dirs':
[ [
'../src/compiler/preprocessor', '../src/compiler/preprocessor',
'third_party/googletest/include',
'third_party/googlemock/include',
], ],
'includes': 'includes':
[ [
...@@ -94,13 +131,12 @@ ...@@ -94,13 +131,12 @@
'dependencies': 'dependencies':
[ [
'../src/angle.gyp:translator_static', '../src/angle.gyp:translator_static',
'gtest', 'test_support',
], ],
'include_dirs': 'include_dirs':
[ [
'../include', '../include',
'../src', '../src',
'third_party/googletest/include',
], ],
'includes': 'includes':
[ [
...@@ -144,14 +180,13 @@ ...@@ -144,14 +180,13 @@
[ [
'../src/angle.gyp:libGLESv2', '../src/angle.gyp:libGLESv2',
'../src/angle.gyp:libEGL', '../src/angle.gyp:libEGL',
'gtest',
'../util/util.gyp:angle_util', '../util/util.gyp:angle_util',
'test_support',
], ],
'include_dirs': 'include_dirs':
[ [
'../include', '../include',
'angle_tests', 'angle_tests',
'third_party/googletest/include',
], ],
'sources': 'sources':
[ [
...@@ -164,15 +199,12 @@ ...@@ -164,15 +199,12 @@
'includes': [ '../build/common_defines.gypi', ], 'includes': [ '../build/common_defines.gypi', ],
'dependencies': 'dependencies':
[ [
'gtest', 'test_support',
'gmock',
], ],
'include_dirs': 'include_dirs':
[ [
'../include', '../include',
'angle_tests', 'angle_tests',
'third_party/googletest/include',
'third_party/googlemock/include',
], ],
'sources': 'sources':
[ [
...@@ -188,11 +220,11 @@ ...@@ -188,11 +220,11 @@
'../src/angle.gyp:libGLESv2', '../src/angle.gyp:libGLESv2',
'../src/angle.gyp:libEGL', '../src/angle.gyp:libEGL',
'../util/util.gyp:angle_util', '../util/util.gyp:angle_util',
'test_support',
], ],
'include_dirs': 'include_dirs':
[ [
'../include', '../include',
'third_party/googletest/include',
], ],
'sources': 'sources':
[ [
...@@ -216,15 +248,12 @@ ...@@ -216,15 +248,12 @@
'dependencies': 'dependencies':
[ [
'../src/angle.gyp:libGLESv2_static', '../src/angle.gyp:libGLESv2_static',
'gtest', 'test_support',
'gmock',
], ],
'include_dirs': 'include_dirs':
[ [
'../include', '../include',
'../src', '../src',
'third_party/googletest/include',
'third_party/googlemock/include',
], ],
'includes': 'includes':
[ [
...@@ -282,9 +311,9 @@ ...@@ -282,9 +311,9 @@
[ [
'../src/angle.gyp:libGLESv2', '../src/angle.gyp:libGLESv2',
'../src/angle.gyp:libEGL', '../src/angle.gyp:libEGL',
'gtest',
'third_party/gles_conformance_tests/conform/GTF_ES/glsl/GTF/es_cts.gyp:es_cts_test_data', 'third_party/gles_conformance_tests/conform/GTF_ES/glsl/GTF/es_cts.gyp:es_cts_test_data',
'third_party/gles_conformance_tests/conform/GTF_ES/glsl/GTF/es_cts.gyp:es2_cts', 'third_party/gles_conformance_tests/conform/GTF_ES/glsl/GTF/es_cts.gyp:es2_cts',
'test_support',
], ],
'variables': 'variables':
{ {
...@@ -300,7 +329,6 @@ ...@@ -300,7 +329,6 @@
[ [
'../include', '../include',
'gles_conformance_tests', 'gles_conformance_tests',
'third_party/googletest/include',
], ],
'defines': 'defines':
[ [
...@@ -340,9 +368,9 @@ ...@@ -340,9 +368,9 @@
[ [
'../src/angle.gyp:libGLESv2', '../src/angle.gyp:libGLESv2',
'../src/angle.gyp:libEGL', '../src/angle.gyp:libEGL',
'gtest',
'third_party/gles_conformance_tests/conform/GTF_ES/glsl/GTF/es_cts.gyp:es_cts_test_data', 'third_party/gles_conformance_tests/conform/GTF_ES/glsl/GTF/es_cts.gyp:es_cts_test_data',
'third_party/gles_conformance_tests/conform/GTF_ES/glsl/GTF/es_cts.gyp:es3_cts', 'third_party/gles_conformance_tests/conform/GTF_ES/glsl/GTF/es_cts.gyp:es3_cts',
'test_support',
], ],
'variables': 'variables':
{ {
...@@ -358,7 +386,6 @@ ...@@ -358,7 +386,6 @@
[ [
'../include', '../include',
'gles_conformance_tests', 'gles_conformance_tests',
'third_party/googletest/include',
], ],
'defines': 'defines':
[ [
...@@ -412,14 +439,13 @@ ...@@ -412,14 +439,13 @@
[ [
'../src/angle.gyp:libGLESv2', '../src/angle.gyp:libGLESv2',
'../src/angle.gyp:libEGL', '../src/angle.gyp:libEGL',
'gtest',
'third_party/deqp/src/deqp/modules/gles3/gles3.gyp:deqp-gles3', 'third_party/deqp/src/deqp/modules/gles3/gles3.gyp:deqp-gles3',
'third_party/deqp/src/deqp/framework/platform/platform.gyp:tcutil-platform', 'third_party/deqp/src/deqp/framework/platform/platform.gyp:tcutil-platform',
'test_support',
], ],
'include_dirs': 'include_dirs':
[ [
'../include', '../include',
'third_party/googletest/include',
'deqp_tests', 'deqp_tests',
], ],
'variables': 'variables':
......
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