1 # 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': [ 33 '../bindings/bindings.gypi', 34 '../build/features.gypi', 35 '../build/scripts/scripts.gypi', 36 '../core/core.gypi', 37 '../modules/modules.gypi', 38 '../web/web.gypi', 39 '../wtf/wtf.gypi', 40 ], 41 'targets': [ 42 { 43 'target_name': 'webkit_unit_tests_resources', 44 'type': 'none', 45 'dependencies': [ 46 '<(DEPTH)/net/net.gyp:net_resources', 47 '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources', 48 '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources', 49 '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings', 50 ], 51 'actions': [{ 52 'action_name': 'repack_webkit_unit_tests_resources', 53 'variables': { 54 'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py', 55 'pak_inputs': [ 56 '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak', 57 '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak', 58 '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak', 59 '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak', 60 '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak', 61 ]}, 62 'inputs': [ 63 '<(repack_path)', 64 '<@(pak_inputs)', 65 ], 66 'outputs': [ 67 '<(PRODUCT_DIR)/webkit_unit_tests_resources.pak', 68 ], 69 'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'], 70 }], 71 'conditions': [ 72 ['OS=="mac"', { 73 'all_dependent_settings': { 74 'mac_bundle_resources': [ 75 '<(PRODUCT_DIR)/webkit_unit_tests_resources.pak', 76 ], 77 }, 78 }], 79 ] 80 }, 81 { 82 'target_name': 'webkit_unit_tests', 83 'type': 'executable', 84 'variables': { 'enable_wexit_time_destructors': 1, }, 85 'dependencies': [ 86 '../../public/blink.gyp:blink', 87 '../wtf/wtf_tests.gyp:wtf_unittest_helpers', 88 '<(DEPTH)/base/base.gyp:base', 89 '<(DEPTH)/base/base.gyp:base_i18n', 90 '<(DEPTH)/base/base.gyp:test_support_base', 91 '<(DEPTH)/testing/gmock.gyp:gmock', 92 '<(DEPTH)/testing/gtest.gyp:gtest', 93 '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp', 94 '<(DEPTH)/third_party/zlib/zlib.gyp:zlib', 95 '<(DEPTH)/url/url.gyp:url_lib', 96 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8', 97 '<(DEPTH)/content/content_shell_and_tests.gyp:content_webkit_unit_test_support', 98 'webkit_unit_tests_resources', 99 ], 100 'sources': [ 101 '../web/tests/RunAllTests.cpp', 102 ], 103 'include_dirs': [ 104 '../../public/web', 105 '../web', 106 'src', 107 ], 108 'conditions': [ 109 ['component=="shared_library"', { 110 'defines': [ 111 'BLINK_DLL_UNITTEST', 112 ], 113 }, { 114 'dependencies': [ 115 '../core/core.gyp:webcore', 116 ], 117 'defines': [ 118 'BLINK_IMPLEMENTATION=1', 119 'INSIDE_BLINK', 120 ], 121 'sources': [ 122 '<@(bindings_unittest_files)', 123 '<@(core_unittest_files)', 124 '<@(modules_unittest_files)', 125 '<@(web_unittest_files)', 126 ], 127 'conditions': [ 128 ['toolkit_uses_gtk == 1', { 129 'include_dirs': [ 130 '../../public/web/gtk', 131 ], 132 'variables': { 133 # FIXME: Enable warnings on other platforms. 134 'chromium_code': 1, 135 }, 136 }], 137 ], 138 }], 139 ['OS=="win" and component!="shared_library"', { 140 'configurations': { 141 'Debug_Base': { 142 'msvs_settings': { 143 'VCLinkerTool': { 144 'LinkIncremental': '<(msvs_large_module_debug_link_mode)', 145 }, 146 }, 147 }, 148 }, 149 'conditions': [ 150 ['win_use_allocator_shim==1', { 151 'dependencies': [ 152 '<(DEPTH)/base/allocator/allocator.gyp:allocator', 153 ], 154 }], 155 ], 156 }], 157 ['OS=="android" and gtest_target_type == "shared_library"', { 158 'type': 'shared_library', 159 'dependencies': [ 160 '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code', 161 '<(DEPTH)/tools/android/forwarder2/forwarder.gyp:forwarder2', 162 ], 163 }], 164 ['OS=="mac"', { 165 'include_dirs': [ 166 '../../public/web/mac', 167 ], 168 }], 169 [ 'os_posix==1 and OS!="mac" and OS!="android" and OS!="ios" and linux_use_tcmalloc==1', { 170 'dependencies': [ 171 '<(DEPTH)/base/allocator/allocator.gyp:allocator', 172 ], 173 }], 174 ], 175 } 176 ], # targets 177 'conditions': [ 178 ['gcc_version>=46', { 179 'target_defaults': { 180 # Disable warnings about c++0x compatibility, as some names (such 181 # as nullptr) conflict with upcoming c++0x types. 182 'cflags_cc': ['-Wno-c++0x-compat'], 183 }, 184 }], 185 ['OS=="android" and android_webview_build==0 and gtest_target_type == "shared_library"', { 186 # Wrap libwebkit_unit_tests.so into an android apk for execution. 187 'targets': [{ 188 'target_name': 'webkit_unit_tests_apk', 189 'type': 'none', 190 'dependencies': [ 191 '<(DEPTH)/base/base.gyp:base_java', 192 '<(DEPTH)/net/net.gyp:net_java', 193 'webkit_unit_tests', 194 ], 195 'variables': { 196 'test_suite_name': 'webkit_unit_tests', 197 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)webkit_unit_tests<(SHARED_LIB_SUFFIX)', 198 }, 199 'includes': [ '../../../../build/apk_test.gypi' ], 200 }], 201 }], 202 ], 203 } 204