blob: 961b73b9a1ddc94f56d7424d93fe6be317f612bb [file] [log] [blame]
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +00001#
2# Copyright (C) 2011 Google Inc. All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met:
7#
8# * Redistributions of source code must retain the above copyright
9# notice, this list of conditions and the following disclaimer.
10# * Redistributions in binary form must reproduce the above
11# copyright notice, this list of conditions and the following disclaimer
12# in the documentation and/or other materials provided with the
13# distribution.
14# * Neither the name of Google Inc. nor the names of its
15# contributors may be used to endorse or promote products derived from
16# this software without specific prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29#
30
31{
32 'includes': [
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +010033 '../bindings/bindings.gypi',
Torne (Richard Coles)1e202182013-10-18 15:46:42 +010034 '../build/features.gypi',
Torne (Richard Coles)f79f16f2013-10-31 11:16:44 +000035 '../build/scripts/scripts.gypi',
36 '../core/core.gypi',
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +010037 '../modules/modules.gypi',
Torne (Richard Coles)09380292014-02-21 12:17:33 +000038 '../platform/blink_platform.gypi',
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +010039 '../web/web.gypi',
40 '../wtf/wtf.gypi',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +000041 ],
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +000042 'targets': [
43 {
Torne (Richard Coles)a854de02013-12-18 16:25:25 +000044 'target_name': 'webkit_unit_tests_resources',
45 'type': 'none',
46 'dependencies': [
47 '<(DEPTH)/net/net.gyp:net_resources',
48 '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
49 '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
50 '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
51 ],
52 'actions': [{
53 'action_name': 'repack_webkit_unit_tests_resources',
54 'variables': {
55 'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py',
56 'pak_inputs': [
57 '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
58 '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak',
59 '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak',
60 '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak',
61 '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak',
62 ]},
63 'inputs': [
64 '<(repack_path)',
65 '<@(pak_inputs)',
66 ],
67 'outputs': [
68 '<(PRODUCT_DIR)/webkit_unit_tests_resources.pak',
69 ],
70 'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
71 }],
72 'conditions': [
73 ['OS=="mac"', {
74 'all_dependent_settings': {
75 'mac_bundle_resources': [
76 '<(PRODUCT_DIR)/webkit_unit_tests_resources.pak',
77 ],
78 },
79 }],
80 ]
81 },
82 {
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +000083 'target_name': 'webkit_unit_tests',
84 'type': 'executable',
85 'variables': { 'enable_wexit_time_destructors': 1, },
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +000086 'dependencies': [
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +010087 '../../public/blink.gyp:blink',
Torne (Richard Coles)a854de02013-12-18 16:25:25 +000088 '../wtf/wtf_tests.gyp:wtf_unittest_helpers',
Torne (Richard Coles)09380292014-02-21 12:17:33 +000089 'web.gyp:webkit_test_support',
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010090 '<(DEPTH)/base/base.gyp:base',
91 '<(DEPTH)/base/base.gyp:base_i18n',
92 '<(DEPTH)/base/base.gyp:test_support_base',
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010093 '<(DEPTH)/testing/gmock.gyp:gmock',
94 '<(DEPTH)/testing/gtest.gyp:gtest',
Ben Murdoch591b9582013-07-10 11:41:44 +010095 '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010096 '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
Torne (Richard Coles)521d96e2013-06-19 11:58:24 +010097 '<(DEPTH)/url/url.gyp:url_lib',
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +010098 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
Torne (Richard Coles)bfe35902013-10-22 16:41:51 +010099 '<(DEPTH)/content/content_shell_and_tests.gyp:content_webkit_unit_test_support',
Torne (Richard Coles)a854de02013-12-18 16:25:25 +0000100 'webkit_unit_tests_resources',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000101 ],
102 'sources': [
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +0100103 '../web/tests/RunAllTests.cpp',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000104 ],
105 'include_dirs': [
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +0100106 '../../public/web',
107 '../web',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000108 'src',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000109 ],
110 'conditions': [
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100111 ['component=="shared_library"', {
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000112 'defines': [
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100113 'BLINK_DLL_UNITTEST',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000114 ],
115 }, {
116 'dependencies': [
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +0100117 '../core/core.gyp:webcore',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000118 ],
119 'defines': [
Torne (Richard Coles)06f816c2013-09-26 13:25:12 +0100120 'BLINK_IMPLEMENTATION=1',
Torne (Richard Coles)1e202182013-10-18 15:46:42 +0100121 'INSIDE_BLINK',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000122 ],
123 'sources': [
Ben Murdoche69819b2013-07-17 14:56:49 +0100124 '<@(bindings_unittest_files)',
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100125 '<@(core_unittest_files)',
Torne (Richard Coles)5267f702013-06-11 10:57:24 +0100126 '<@(modules_unittest_files)',
Torne (Richard Coles)09380292014-02-21 12:17:33 +0000127 '<@(platform_web_unittest_files)',
Ben Murdoche69819b2013-07-17 14:56:49 +0100128 '<@(web_unittest_files)',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000129 ],
130 'conditions': [
131 ['toolkit_uses_gtk == 1', {
132 'include_dirs': [
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +0100133 '../../public/web/gtk',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000134 ],
135 'variables': {
136 # FIXME: Enable warnings on other platforms.
137 'chromium_code': 1,
138 },
139 }],
140 ],
141 }],
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100142 ['OS=="win" and component!="shared_library"', {
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000143 'configurations': {
144 'Debug_Base': {
145 'msvs_settings': {
146 'VCLinkerTool': {
147 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
148 },
149 },
150 },
151 },
Torne (Richard Coles)51b29062013-11-28 11:56:03 +0000152 'conditions': [
153 ['win_use_allocator_shim==1', {
154 'dependencies': [
155 '<(DEPTH)/base/allocator/allocator.gyp:allocator',
156 ],
157 }],
158 ],
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000159 }],
160 ['OS=="android" and gtest_target_type == "shared_library"', {
161 'type': 'shared_library',
162 'dependencies': [
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100163 '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
164 '<(DEPTH)/tools/android/forwarder2/forwarder.gyp:forwarder2',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000165 ],
166 }],
167 ['OS=="mac"', {
168 'include_dirs': [
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +0100169 '../../public/web/mac',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000170 ],
171 }],
Torne (Richard Coles)d5428f32014-03-18 10:21:16 +0000172 # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
173 [ 'os_posix==1 and OS!="mac" and OS!="android" and OS!="ios" and ((use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1))', {
Torne (Richard Coles)926b0012013-03-28 15:32:48 +0000174 'dependencies': [
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100175 '<(DEPTH)/base/allocator/allocator.gyp:allocator',
Torne (Richard Coles)926b0012013-03-28 15:32:48 +0000176 ],
177 }],
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000178 ],
Ben Murdochfff88842013-07-30 15:20:09 +0100179 }
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000180 ], # targets
181 'conditions': [
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100182 ['gcc_version>=46', {
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000183 'target_defaults': {
184 # Disable warnings about c++0x compatibility, as some names (such
185 # as nullptr) conflict with upcoming c++0x types.
186 'cflags_cc': ['-Wno-c++0x-compat'],
187 },
188 }],
Torne (Richard Coles)926b0012013-03-28 15:32:48 +0000189 ['OS=="android" and android_webview_build==0 and gtest_target_type == "shared_library"', {
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000190 # Wrap libwebkit_unit_tests.so into an android apk for execution.
191 'targets': [{
192 'target_name': 'webkit_unit_tests_apk',
193 'type': 'none',
194 'dependencies': [
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100195 '<(DEPTH)/base/base.gyp:base_java',
196 '<(DEPTH)/net/net.gyp:net_java',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000197 'webkit_unit_tests',
198 ],
199 'variables': {
Torne (Richard Coles)53e740f2013-05-09 18:38:43 +0100200 'test_suite_name': 'webkit_unit_tests',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000201 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)webkit_unit_tests<(SHARED_LIB_SUFFIX)',
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000202 },
Torne (Richard Coles)f5e4ad52013-08-05 13:57:57 +0100203 'includes': [ '../../../../build/apk_test.gypi' ],
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000204 }],
205 }],
Torne (Richard Coles)5c87bf82012-11-14 11:46:17 +0000206 ],
207}