Home | History | Annotate | Download | only in web
      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         '../platform/blink_platform.gypi',
     39         '../web/web.gypi',
     40         '../wtf/wtf.gypi',
     41     ],
     42     'targets': [
     43         {
     44             '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         {
     83             'target_name': 'webkit_unit_tests',
     84             'type': 'executable',
     85             'variables': { 'enable_wexit_time_destructors': 1, },
     86             'dependencies': [
     87                 '../config.gyp:unittest_config',
     88                 '../../public/blink.gyp:blink',
     89                 '../wtf/wtf_tests.gyp:wtf_unittest_helpers',
     90                 'web.gyp:blink_web_test_support',
     91                 '<(DEPTH)/base/base.gyp:base',
     92                 '<(DEPTH)/base/base.gyp:base_i18n',
     93                 '<(DEPTH)/base/base.gyp:test_support_base',
     94                 '<(DEPTH)/testing/gmock.gyp:gmock',
     95                 '<(DEPTH)/testing/gtest.gyp:gtest',
     96                 '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
     97                 '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
     98                 '<(DEPTH)/url/url.gyp:url_lib',
     99                 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
    100                 '<(DEPTH)/content/content_shell_and_tests.gyp:test_support_content',
    101                 'webkit_unit_tests_resources',
    102             ],
    103             'sources': [
    104                 '../web/tests/RunAllTests.cpp',
    105             ],
    106             'include_dirs': [
    107                 '../../public/web',
    108                 '../web',
    109                 'src',
    110             ],
    111             'conditions': [
    112                 ['component=="shared_library"', {
    113                     'defines': [
    114                         'BLINK_DLL_UNITTEST',
    115                     ],
    116                 }, {
    117                     'dependencies': [
    118                         '../core/core.gyp:webcore',
    119                     ],
    120                     'defines': [
    121                         'BLINK_IMPLEMENTATION=1',
    122                         'INSIDE_BLINK',
    123                     ],
    124                     'sources': [
    125                         '<@(bindings_unittest_files)',
    126                         '<@(core_unittest_files)',
    127                         '<@(modules_unittest_files)',
    128                         '<@(platform_web_unittest_files)',
    129                         '<@(web_unittest_files)',
    130                     ],
    131                 }],
    132                 ['OS=="win" and component!="shared_library"', {
    133                     'configurations': {
    134                         'Debug_Base': {
    135                             'msvs_settings': {
    136                                 'VCLinkerTool': {
    137                                     'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
    138                                 },
    139                             },
    140                         },
    141                     },
    142                     'conditions': [
    143                         ['win_use_allocator_shim==1', {
    144                             'dependencies': [
    145                                 '<(DEPTH)/base/allocator/allocator.gyp:allocator',
    146                             ],
    147                         }],
    148                     ],
    149                 }],
    150                 ['OS=="android"', {
    151                     'type': 'shared_library',
    152                     'dependencies': [
    153                         '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
    154                         '<(DEPTH)/tools/android/forwarder2/forwarder.gyp:forwarder2',
    155                     ],
    156                 }],
    157                 ['OS=="mac"', {
    158                     'include_dirs': [
    159                         '../../public/web/mac',
    160                     ],
    161                 }],
    162                 [ 'os_posix==1 and OS!="mac" and OS!="android" and OS!="ios" and use_allocator!="none"', {
    163                     'dependencies': [
    164                         '<(DEPTH)/base/allocator/allocator.gyp:allocator',
    165                     ],
    166                 }],
    167             ],
    168         }
    169     ], # targets
    170     'conditions': [
    171         ['gcc_version>=46', {
    172             'target_defaults': {
    173                 # Disable warnings about c++0x compatibility, as some names (such
    174                 # as nullptr) conflict with upcoming c++0x types.
    175                 'cflags_cc': ['-Wno-c++0x-compat'],
    176             },
    177         }],
    178         ['OS=="android" and android_webview_build==0 and gtest_target_type == "shared_library"', {
    179             # Wrap libwebkit_unit_tests.so into an android apk for execution.
    180             'targets': [{
    181                 'target_name': 'webkit_unit_tests_apk',
    182                 'type': 'none',
    183                 'dependencies': [
    184                     '<(DEPTH)/base/base.gyp:base_java',
    185                     '<(DEPTH)/net/net.gyp:net_java',
    186                     'webkit_unit_tests',
    187                 ],
    188                 'variables': {
    189                     'test_suite_name': 'webkit_unit_tests',
    190                     'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)webkit_unit_tests<(SHARED_LIB_SUFFIX)',
    191                 },
    192                 'includes': [ '../../../../build/apk_test.gypi' ],
    193             }],
    194         }],
    195     ],
    196 }
    197