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 = {
"third_party/gyp":
"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":
"http://googletest.googlecode.com/svn/trunk@629",
......
......@@ -29,6 +29,9 @@ if __name__ == '__main__':
# Add common.gypi to the include path.
args.append('-I' + os.path.join(script_dir, 'common.gypi'))
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.
args.append(os.path.join(script_dir, 'all.gyp'))
sys.exit(gyp.main(args))
......@@ -26,6 +26,7 @@ def generateProjects(generation_dir, build_winphone):
gyp_cmd += ' -D angle_build_winrt=1'
gyp_cmd += ' -D angle_build_winphone=' + ('1' if build_winphone else '0')
gyp_cmd += ' -D angle_enable_d3d9=0'
gyp_cmd += ' -D angle_standalone=1'
gyp_cmd += ' ' + os.path.join(script_dir, 'all.gyp')
print 'Generating projects to ' + generation_dir + ' from gyp files...'
......
......@@ -7,11 +7,13 @@
{
'angle_build_conformance_tests%': '0',
'angle_build_deqp_tests%': '0',
# build/gyp_angle sets this to 1.
'angle_standalone%': 0,
},
'targets':
[
{
'target_name': 'gtest',
'target_name': 'angle_internal_gtest',
'type': 'static_library',
'includes': [ '../build/common_defines.gypi', ],
'include_dirs':
......@@ -27,17 +29,22 @@
[
'_VARIADIC_MAX=10',
],
'direct_dependent_settings':
'all_dependent_settings':
{
'defines':
[
'_VARIADIC_MAX=10',
],
'include_dirs':
[
'third_party/googletest',
'third_party/googletest/include',
],
},
},
{
'target_name': 'gmock',
'target_name': 'angle_internal_gmock',
'type': 'static_library',
'includes': [ '../build/common_defines.gypi', ],
'include_dirs':
......@@ -54,29 +61,59 @@
[
'_VARIADIC_MAX=10',
],
'direct_dependent_settings':
'all_dependent_settings':
{
'defines':
[
'_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',
'type': 'executable',
'dependencies':
[
'../src/angle.gyp:preprocessor',
'gtest',
'gmock',
'test_support',
],
'include_dirs':
[
'../src/compiler/preprocessor',
'third_party/googletest/include',
'third_party/googlemock/include',
],
'includes':
[
......@@ -94,13 +131,12 @@
'dependencies':
[
'../src/angle.gyp:translator_static',
'gtest',
'test_support',
],
'include_dirs':
[
'../include',
'../src',
'third_party/googletest/include',
],
'includes':
[
......@@ -144,14 +180,13 @@
[
'../src/angle.gyp:libGLESv2',
'../src/angle.gyp:libEGL',
'gtest',
'../util/util.gyp:angle_util',
'test_support',
],
'include_dirs':
[
'../include',
'angle_tests',
'third_party/googletest/include',
],
'sources':
[
......@@ -164,15 +199,12 @@
'includes': [ '../build/common_defines.gypi', ],
'dependencies':
[
'gtest',
'gmock',
'test_support',
],
'include_dirs':
[
'../include',
'angle_tests',
'third_party/googletest/include',
'third_party/googlemock/include',
],
'sources':
[
......@@ -188,11 +220,11 @@
'../src/angle.gyp:libGLESv2',
'../src/angle.gyp:libEGL',
'../util/util.gyp:angle_util',
'test_support',
],
'include_dirs':
[
'../include',
'third_party/googletest/include',
],
'sources':
[
......@@ -216,15 +248,12 @@
'dependencies':
[
'../src/angle.gyp:libGLESv2_static',
'gtest',
'gmock',
'test_support',
],
'include_dirs':
[
'../include',
'../src',
'third_party/googletest/include',
'third_party/googlemock/include',
],
'includes':
[
......@@ -282,9 +311,9 @@
[
'../src/angle.gyp:libGLESv2',
'../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:es2_cts',
'test_support',
],
'variables':
{
......@@ -300,7 +329,6 @@
[
'../include',
'gles_conformance_tests',
'third_party/googletest/include',
],
'defines':
[
......@@ -340,9 +368,9 @@
[
'../src/angle.gyp:libGLESv2',
'../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:es3_cts',
'test_support',
],
'variables':
{
......@@ -358,7 +386,6 @@
[
'../include',
'gles_conformance_tests',
'third_party/googletest/include',
],
'defines':
[
......@@ -412,14 +439,13 @@
[
'../src/angle.gyp:libGLESv2',
'../src/angle.gyp:libEGL',
'gtest',
'third_party/deqp/src/deqp/modules/gles3/gles3.gyp:deqp-gles3',
'third_party/deqp/src/deqp/framework/platform/platform.gyp:tcutil-platform',
'test_support',
],
'include_dirs':
[
'../include',
'third_party/googletest/include',
'deqp_tests',
],
'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