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         '../core/core.gypi',
     35         '../core/features.gypi',
     36         '../modules/modules.gypi',
     37         '../web/web.gypi',
     38         '../wtf/wtf.gypi',
     39     ],
     40     'targets': [
     41         {
     42             'target_name': 'webkit_unit_tests',
     43             'type': 'executable',
     44             'variables': { 'enable_wexit_time_destructors': 1, },
     45             'msvs_guid': '7CEFE800-8403-418A-AD6A-2D52C6FC3EAD',
     46             'dependencies': [
     47                 '../../public/blink.gyp:blink',
     48                 '../testing/testing.gyp:DumpRenderTree_resources',
     49                 '<(DEPTH)/base/base.gyp:base',
     50                 '<(DEPTH)/base/base.gyp:base_i18n',
     51                 '<(DEPTH)/base/base.gyp:test_support_base',
     52                 '<(DEPTH)/testing/gmock.gyp:gmock',
     53                 '<(DEPTH)/testing/gtest.gyp:gtest',
     54                 '<(DEPTH)/third_party/libwebp/libwebp.gyp:libwebp',
     55                 '<(DEPTH)/third_party/zlib/zlib.gyp:zlib',
     56                 '<(DEPTH)/url/url.gyp:url_lib',
     57                 '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
     58                 '<(DEPTH)/content/content.gyp:content_webkit_unit_test_support',
     59             ],
     60             'sources': [
     61                 '../web/tests/RunAllTests.cpp',
     62             ],
     63             'include_dirs': [
     64                 '../../public/web',
     65                 '../web',
     66                 'src',
     67             ],
     68             'conditions': [
     69                 ['component=="shared_library"', {
     70                     'defines': [
     71                         'WEBKIT_DLL_UNITTEST',
     72                     ],
     73                 }, {
     74                     'dependencies': [
     75                         '../core/core.gyp:webcore',
     76                     ],
     77                     'defines': [
     78                         'WEBKIT_IMPLEMENTATION=1',
     79                         'INSIDE_WEBKIT',
     80                     ],
     81                     'sources': [
     82                         '<@(bindings_unittest_files)',
     83                         '<@(core_unittest_files)',
     84                         '<@(modules_unittest_files)',
     85                         '<@(web_unittest_files)',
     86                     ],
     87                     'conditions': [
     88                         ['toolkit_uses_gtk == 1', {
     89                             'include_dirs': [
     90                                 '../../public/web/gtk',
     91                             ],
     92                             'variables': {
     93                             # FIXME: Enable warnings on other platforms.
     94                             'chromium_code': 1,
     95                             },
     96                         }],
     97                     ],
     98                 }],
     99                 ['OS=="win" and component!="shared_library"', {
    100                     'configurations': {
    101                         'Debug_Base': {
    102                             'msvs_settings': {
    103                                 'VCLinkerTool': {
    104                                     'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
    105                                 },
    106                             },
    107                         },
    108                     },
    109                 }],
    110                 ['OS=="android" and gtest_target_type == "shared_library"', {
    111                     'type': 'shared_library',
    112                     'dependencies': [
    113                         '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
    114                         '<(DEPTH)/tools/android/forwarder2/forwarder.gyp:forwarder2',
    115                     ],
    116                 }],
    117                 ['OS=="mac"', {
    118                     'include_dirs': [
    119                         '../../public/web/mac',
    120                     ],
    121                 }],
    122                 [ 'os_posix==1 and OS!="mac" and OS!="android" and OS!="ios" and linux_use_tcmalloc==1', {
    123                     'dependencies': [
    124                         '<(DEPTH)/base/allocator/allocator.gyp:allocator',
    125                     ],
    126                 }],
    127             ],
    128         }
    129     ], # targets
    130     'conditions': [
    131         ['gcc_version>=46', {
    132             'target_defaults': {
    133                 # Disable warnings about c++0x compatibility, as some names (such
    134                 # as nullptr) conflict with upcoming c++0x types.
    135                 'cflags_cc': ['-Wno-c++0x-compat'],
    136             },
    137         }],
    138         ['OS=="android" and android_webview_build==0 and gtest_target_type == "shared_library"', {
    139             # Wrap libwebkit_unit_tests.so into an android apk for execution.
    140             'targets': [{
    141                 'target_name': 'webkit_unit_tests_apk',
    142                 'type': 'none',
    143                 'dependencies': [
    144                     '<(DEPTH)/base/base.gyp:base_java',
    145                     '<(DEPTH)/net/net.gyp:net_java',
    146                     'webkit_unit_tests',
    147                 ],
    148                 'variables': {
    149                     'test_suite_name': 'webkit_unit_tests',
    150                     'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)webkit_unit_tests<(SHARED_LIB_SUFFIX)',
    151                 },
    152                 'includes': [ '../../../../build/apk_test.gypi' ],
    153             }],
    154         }],
    155         ['clang==1', {
    156             'target_defaults': {
    157                 'cflags': ['-Wunused-parameter'],
    158                 'xcode_settings': {
    159                     'WARNING_CFLAGS': ['-Wunused-parameter'],
    160                 },
    161             },
    162         }],
    163     ],
    164 }
    165