~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Tools/TestWebKitAPI/TestWebKitAPI.gyp/TestWebKitAPI.gyp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# Copyright (C) 2012 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
    'variables': {
 
33
        'tools_dir': '../..',
 
34
        'source_dir': '../../../Source',
 
35
        'conditions': [
 
36
            # Location of the chromium src directory and target type is different
 
37
            # if webkit is built inside chromium or as standalone project.
 
38
            ['inside_chromium_build==0', {
 
39
                # Webkit is being built outside of the full chromium project.
 
40
                # e.g. via build-webkit --chromium
 
41
                'chromium_src_dir': '<(source_dir)/WebKit/chromium',
 
42
            },{
 
43
                # WebKit is checked out in src/chromium/third_party/WebKit
 
44
                'chromium_src_dir': '<(tools_dir)/../../..',
 
45
            }],
 
46
        ],
 
47
    },
 
48
    'includes': [
 
49
        '../TestWebKitAPI.gypi',
 
50
        '../../../Source/WebKit/chromium/features.gypi',
 
51
    ],
 
52
    'targets': [
 
53
        {
 
54
            'target_name': 'TestWebKitAPI',
 
55
            'type': 'executable',
 
56
            'dependencies': [
 
57
                '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit',
 
58
                '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf',
 
59
                '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
 
60
                '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
 
61
                '<(chromium_src_dir)/base/base.gyp:test_support_base',
 
62
                '<(chromium_src_dir)/testing/gtest.gyp:gtest',
 
63
                '<(chromium_src_dir)/testing/gmock.gyp:gmock',
 
64
                '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
 
65
            ],
 
66
            'include_dirs': [
 
67
                '<(tools_dir)/TestWebKitAPI',
 
68
                # Needed by tests/RunAllTests.cpp, as well as ChromiumCurrentTime.cpp and
 
69
                # ChromiumThreading.cpp in chromium shared library configuration.
 
70
                '<(source_dir)/WebKit/chromium/public',
 
71
            ],
 
72
            'sources': [
 
73
                # Reuse the same testing driver of Chromium's webkit_unit_tests.
 
74
                '<(source_dir)/WebKit/chromium/tests/RunAllTests.cpp',
 
75
                '<@(TestWebKitAPI_files)',
 
76
            ],
 
77
            'conditions': [
 
78
                ['inside_chromium_build==1 and component=="shared_library"', {
 
79
                    'sources': [
 
80
                        # To satisfy linking of WTF::currentTime() etc. in shared library configuration,
 
81
                        # as the symbols are not exported from the DLLs.
 
82
                        '<(source_dir)/WebKit/chromium/src/ChromiumCurrentTime.cpp',
 
83
                        '<(source_dir)/WebKit/chromium/src/ChromiumThreading.cpp',
 
84
                    ],
 
85
                }],
 
86
                ['OS=="android" and gtest_target_type == "shared_library"', {
 
87
                    'type': 'shared_library',
 
88
                    'dependencies': [
 
89
                        '<(chromium_src_dir)/testing/android/native_test.gyp:native_test_native_code',
 
90
                    ],
 
91
                }],
 
92
            ],
 
93
        },
 
94
    ], # targets
 
95
    'conditions': [
 
96
        ['OS=="android" and gtest_target_type == "shared_library"', {
 
97
            # Wrap libTestWebKitAPI.so into an android apk for execution.
 
98
            'targets': [{
 
99
                'target_name': 'TestWebKitAPI_apk',
 
100
                'type': 'none',
 
101
                'dependencies': [
 
102
                    '<(chromium_src_dir)/base/base.gyp:base',
 
103
                    'TestWebKitAPI',
 
104
                ],
 
105
                'variables': {
 
106
                    'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)TestWebKitAPI<(SHARED_LIB_SUFFIX)',
 
107
                    'input_jars_paths': [
 
108
                        '<(PRODUCT_DIR)/lib.java/chromium_base.jar',
 
109
                    ],
 
110
                    'conditions': [
 
111
                        ['inside_chromium_build==1', {
 
112
                            'ant_build_to_chromium_src': '<(ant_build_out)/../../',
 
113
                        }, {
 
114
                            'ant_build_to_chromium_src': '<(chromium_src_dir)',
 
115
                        }],
 
116
                    ],
 
117
                },
 
118
                # Part of the following was copied from <(chromium_src_dir)/build/apk_test.gpyi.
 
119
                # Not including it because gyp include doesn't support variable in path or under
 
120
                # conditions. And we also have some different requirements.
 
121
                'actions': [{
 
122
                    'action_name': 'apk_TestWebKitAPI',
 
123
                    'message': 'Building TestWebKitAPI test apk.',
 
124
                    'inputs': [
 
125
                        '<(chromium_src_dir)/testing/android/AndroidManifest.xml',
 
126
                        '<(chromium_src_dir)/testing/android/generate_native_test.py',
 
127
                        '<(input_shlib_path)',
 
128
                        '<@(input_jars_paths)',
 
129
                    ],
 
130
                    'outputs': [
 
131
                        '<(PRODUCT_DIR)/TestWebKitAPI_apk/TestWebKitAPI-debug.apk',
 
132
                    ],
 
133
                    'action': [
 
134
                        '<(chromium_src_dir)/testing/android/generate_native_test.py',
 
135
                        '--native_library',
 
136
                        '<(input_shlib_path)',
 
137
                        '--jars',
 
138
                        '"<@(input_jars_paths)"',
 
139
                        '--output',
 
140
                        '<(PRODUCT_DIR)/TestWebKitAPI_apk',
 
141
                        '--strip-binary=<(android_strip)',
 
142
                        '--ant-args',
 
143
                        '-DANDROID_SDK=<(android_sdk)',
 
144
                        '--ant-args',
 
145
                        '-DANDROID_SDK_ROOT=<(android_sdk_root)',
 
146
                        '--ant-args',
 
147
                        '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
 
148
                        '--ant-args',
 
149
                        '-DANDROID_SDK_VERSION=<(android_sdk_version)',
 
150
                        '--ant-args',
 
151
                        '-DANDROID_TOOLCHAIN=<(android_toolchain)',
 
152
                        '--ant-args',
 
153
                        '-DANDROID_GDBSERVER=<(android_gdbserver)',
 
154
                        '--ant-args',
 
155
                        '-DPRODUCT_DIR=<(ant_build_out)',
 
156
                        '--ant-args',
 
157
                        '-DCHROMIUM_SRC=<(ant_build_to_chromium_src)',
 
158
                        '--app_abi',
 
159
                        '<(android_app_abi)',
 
160
                    ],
 
161
                }],
 
162
            }],
 
163
        }],
 
164
    ],
 
165
}