[Qt] Unreviewed gardening, remove unnecessary expected files.
[WebKit-https.git] / Tools / DumpRenderTree / DumpRenderTree.gyp / DumpRenderTree.gyp
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     'variables': {
33         'ahem_path': '../../DumpRenderTree/qt/fonts/AHEM____.TTF',
34         'tools_dir': '../..',
35         'source_dir': '../../../Source',
36         'conditions': [
37             # Location of the chromium src directory and target type is different
38             # if webkit is built inside chromium or as standalone project.
39             ['inside_chromium_build==0', {
40                 # Webkit is being built outside of the full chromium project.
41                 # e.g. via build-webkit --chromium
42                 'chromium_src_dir': '<(source_dir)/WebKit/chromium',
43             },{
44                 # WebKit is checked out in src/chromium/third_party/WebKit
45                 'chromium_src_dir': '<(tools_dir)/../../..',
46             }],
47         ],
48     },
49     'includes': [
50         '../DumpRenderTree.gypi',
51         '../../../Source/WebKit/chromium/features.gypi',
52     ],
53     'targets': [
54         {
55             'target_name': 'ImageDiff',
56             'type': 'executable',
57             'dependencies': [
58                 '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support_gfx',
59             ],
60             'include_dirs': [
61                 '<(DEPTH)',
62             ],
63             'sources': [
64                 '<(tools_dir)/DumpRenderTree/chromium/ImageDiff.cpp',
65             ],
66             'conditions': [
67                 ['OS=="android" and android_build_type==0', {
68                     # The Chromium Android port will compare images on host rather
69                     # than target (a device or emulator) for performance reasons.
70                     'toolsets': ['host'],
71                 }],
72                 ['OS=="android" and android_build_type!=0', {
73                     'type': 'none',
74                 }],
75             ],
76         },
77         {
78             'target_name': 'TestRunner',
79             'type': 'static_library',
80             'dependencies': [
81                 '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit',
82                 '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf',
83                 '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
84             ],
85             'include_dirs': [
86                 '<(chromium_src_dir)',
87                 '<(source_dir)/WebKit/chromium/public',
88                 '<(DEPTH)',
89                 '../chromium/TestRunner',
90             ],
91             'direct_dependent_settings': {
92                 'include_dirs': [
93                     '../chromium/TestRunner',
94                 ],
95             },
96             'sources': [
97                 '<@(test_runner_files)',
98             ],
99         },
100         {
101             'target_name': 'DumpRenderTree',
102             'type': 'executable',
103             'mac_bundle': 1,
104             'dependencies': [
105                 'ImageDiff',
106                 'TestRunner',
107                 'copy_TestNetscapePlugIn',
108                 '<(source_dir)/WebKit/chromium/WebKit.gyp:inspector_resources',
109                 '<(source_dir)/WebKit/chromium/WebKit.gyp:webkit',
110                 '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf',
111                 '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
112                 '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc',
113                 '<(chromium_src_dir)/third_party/mesa/mesa.gyp:osmesa',
114                 '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
115                 '<(chromium_src_dir)/base/base.gyp:test_support_base',
116                 '<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob',
117                 '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support',
118                 '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_user_agent',
119             ],
120             'include_dirs': [
121                 '<(chromium_src_dir)',
122                 '<(source_dir)/WebKit/chromium/public',
123                 '<(DEPTH)',
124             ],
125             'defines': [
126                 # Technically not a unit test but require functions available only to
127                 # unit tests.
128                 'UNIT_TEST',
129             ],
130             'sources': [
131                 '<@(drt_files)',
132             ],
133             'conditions': [
134                 ['OS=="mac" or OS=="win" or toolkit_uses_gtk==1', {
135                     # These platforms have their own implementations of
136                     # checkLayoutTestSystemDependencies() and openStartupDialog().
137                     'sources/': [
138                         ['exclude', 'TestShellStub\\.cpp$'],
139                     ],
140                 }],
141                 ['OS=="win"', {
142                     'dependencies': [
143                         'LayoutTestHelper',
144                         '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:libEGL',
145                         '<(chromium_src_dir)/third_party/angle/src/build_angle.gyp:libGLESv2',
146                     ],
147                     'resource_include_dirs': ['<(SHARED_INTERMEDIATE_DIR)/webkit'],
148                     'sources': [
149                         '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
150                         '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc',
151                         '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.rc',
152                         '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.rc',
153                     ],
154                     'conditions': [
155                         ['inside_chromium_build==1', {
156                             'configurations': {
157                                 'Debug_Base': {
158                                     'msvs_settings': {
159                                         'VCLinkerTool': {
160                                             'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
161                                         },
162                                     },
163                                 },
164                             },
165                         }],
166                     ],
167                     'copies': [{
168                         'destination': '<(PRODUCT_DIR)',
169                         'files': ['<(ahem_path)'],
170                     }],
171                 },{ # OS!="win"
172                     'sources/': [
173                         ['exclude', 'Win\\.cpp$'],
174                     ],
175                     'actions': [
176                         {
177                             'action_name': 'repack_locale',
178                             'variables': {
179                                 'repack_path': '<(chromium_src_dir)/tools/grit/grit/format/repack.py',
180                                 'pak_inputs': [
181                                     '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
182                                     '<(SHARED_INTERMEDIATE_DIR)/ui/gfx/gfx_resources.pak',
183                                     '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.pak',
184                                     '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak',
185                                     '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources.pak',
186                             ]},
187                             'inputs': [
188                                 '<(repack_path)',
189                                 '<@(pak_inputs)',
190                             ],
191                             'outputs': [
192                                 '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak',
193                             ],
194                             'action': ['python', '<(repack_path)', '<@(_outputs)', '<@(pak_inputs)'],
195                             'process_outputs_as_mac_bundle_resources': 1,
196                         },
197                     ], # actions
198                 }],
199                 ['OS=="mac"', {
200                     'dependencies': [
201                         '<(source_dir)/WebKit/chromium/WebKit.gyp:copy_mesa',
202                         'LayoutTestHelper',
203                     ],
204                     'mac_bundle_resources': [
205                         '<(ahem_path)',
206                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher100.ttf',
207                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher200.ttf',
208                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher300.ttf',
209                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher400.ttf',
210                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher500.ttf',
211                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher600.ttf',
212                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher700.ttf',
213                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher800.ttf',
214                         '<(tools_dir)/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf',
215                         '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
216                     ],
217                 },{ # OS!="mac"
218                     'sources/': [
219                         # .mm is already excluded by common.gypi
220                         ['exclude', 'Mac\\.cpp$'],
221                     ],
222                 }],
223                 ['os_posix!=1 or OS=="mac"', {
224                     'sources/': [
225                         ['exclude', 'Posix\\.cpp$'],
226                     ],
227                 }],
228                 ['use_x11 == 1', {
229                     'dependencies': [
230                         '<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
231                     ],
232                     'copies': [{
233                         'destination': '<(PRODUCT_DIR)',
234                         'files': [
235                             '<(ahem_path)',
236                             '<(tools_dir)/DumpRenderTree/chromium/fonts.conf',
237                             '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak',
238                         ]
239                     }],
240                     'variables': {
241                         # FIXME: Enable warnings on other platforms.
242                         'chromium_code': 1,
243                     },
244                     'conditions': [
245                         ['linux_use_tcmalloc == 1', {
246                             'dependencies': [
247                                 '<(chromium_src_dir)/base/allocator/allocator.gyp:allocator',
248                             ],
249                         }],
250                     ],
251                 },{ # use_x11 != 1
252                     'sources/': [
253                         ['exclude', 'X11\\.cpp$'],
254                     ]
255                 }],
256                 ['toolkit_uses_gtk == 1', {
257                     'defines': [
258                         'WTF_USE_GTK=1',
259                     ],
260                     'dependencies': [
261                         '<(chromium_src_dir)/build/linux/system.gyp:gtk',
262                     ],
263                     'include_dirs': [
264                         '<(source_dir)/WebKit/chromium/public/gtk',
265                     ],
266                 }],
267                 ['OS=="android"', {
268                     'type': 'shared_library',
269                     'dependencies': [
270                         '<(chromium_src_dir)/base/base.gyp:test_support_base',
271                         '<(chromium_src_dir)/tools/android/forwarder/forwarder.gyp:forwarder',
272                         '<(chromium_src_dir)/testing/android/native_test.gyp:native_test_native_code',
273                     ],
274                     'dependencies!': [
275                         'ImageDiff',
276                         'copy_TestNetscapePlugIn',
277                         '<(chromium_src_dir)/third_party/mesa/mesa.gyp:osmesa',
278                     ],
279                     'copies': [{
280                         'destination': '<(PRODUCT_DIR)',
281                         'files': [
282                             '<(ahem_path)',
283                             '<(tools_dir)/DumpRenderTree/chromium/android_main_fonts.xml',
284                             '<(tools_dir)/DumpRenderTree/chromium/android_fallback_fonts.xml',
285                             '<(INTERMEDIATE_DIR)/repack/DumpRenderTree.pak',
286                         ]
287                     }],
288                 }, { # OS!="android"
289                     'sources/': [
290                         ['exclude', 'Android\\.cpp$'],
291                     ],
292                 }],
293                 ['OS=="android" and android_build_type==0', {
294                     'dependencies': [
295                         'ImageDiff#host',
296                     ],
297                 }],
298                 ['inside_chromium_build==1 and component=="shared_library"', {
299                     'sources': [
300                         '<(source_dir)/WebKit/chromium/src/ChromiumCurrentTime.cpp',
301                         '<(source_dir)/WebKit/chromium/src/ChromiumThreading.cpp',
302                     ],
303                     'include_dirs': [
304                         '<(source_dir)/WebKit/chromium/public',
305                     ],
306                     'dependencies': [
307                         '<(source_dir)/WTF/WTF.gyp/WTF.gyp:wtf',
308                     ],
309                 }],
310                 ['inside_chromium_build==0', {
311                     'dependencies': [
312                         '<(chromium_src_dir)/webkit/support/setup_third_party.gyp:third_party_headers',
313                     ]
314                 }],
315                 ['inside_chromium_build==0 or component!="shared_library"', {
316                     'dependencies': [
317                         '<(source_dir)/WebCore/WebCore.gyp/WebCore.gyp:webcore_test_support',
318                     ],
319                     'include_dirs': [
320                         # WARNING: Do not view this particular case as a precedent for
321                         # including WebCore headers in DumpRenderTree project.
322                         '<(source_dir)/WebCore/testing/v8', # for WebCoreTestSupport.h, needed to link in window.internals code.
323                     ],
324                     'sources': [
325                         '<(source_dir)/WebKit/chromium/src/WebTestingSupport.cpp',
326                         '<(source_dir)/WebKit/chromium/public/WebTestingSupport.h',
327                     ],
328                 }],
329             ],
330         },
331         {
332             'target_name': 'TestNetscapePlugIn',
333             'type': 'loadable_module',
334             'sources': [ '<@(test_plugin_files)' ],
335             'dependencies': [
336                 '<(chromium_src_dir)/third_party/npapi/npapi.gyp:npapi',
337             ],
338             'include_dirs': [
339                 '<(chromium_src_dir)',
340                 '<(tools_dir)/DumpRenderTree/TestNetscapePlugIn',
341                 '<(tools_dir)/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders',
342             ],
343             'conditions': [
344                 ['OS=="mac"', {
345                     'mac_bundle': 1,
346                     'product_extension': 'plugin',
347                     'link_settings': {
348                         'libraries': [
349                             '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
350                             '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
351                             '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
352                         ]
353                     },
354                     'xcode_settings': {
355                         'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
356                         'INFOPLIST_FILE': '<(tools_dir)/DumpRenderTree/TestNetscapePlugIn/mac/Info.plist',
357                     },
358                 }],
359                 ['os_posix == 1 and OS != "mac"', {
360                     'cflags': [
361                         '-fvisibility=default',
362                     ],
363                 }],
364                 ['OS=="win"', {
365                     'defines': [
366                         # This seems like a hack, but this is what Safari Win does.
367                         'snprintf=_snprintf',
368                     ],
369                     'sources': [
370                         '<(tools_dir)/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.def',
371                         '<(tools_dir)/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.rc',
372                     ],
373                     # The .rc file requires that the name of the dll is npTestNetscapePlugIn.dll.
374                     'product_name': 'npTestNetscapePlugIn',
375                 }],
376             ],
377         },
378         {
379             'target_name': 'copy_TestNetscapePlugIn',
380             'type': 'none',
381             'dependencies': [
382                 'TestNetscapePlugIn',
383             ],
384             'conditions': [
385                 ['OS=="win"', {
386                     'copies': [{
387                         'destination': '<(PRODUCT_DIR)/plugins',
388                         'files': ['<(PRODUCT_DIR)/npTestNetscapePlugIn.dll'],
389                     }],
390                 }],
391                 ['OS=="mac"', {
392                     'dependencies': ['TestNetscapePlugIn'],
393                     'copies': [{
394                         'destination': '<(PRODUCT_DIR)/plugins/',
395                         'files': ['<(PRODUCT_DIR)/TestNetscapePlugIn.plugin/'],
396                     }],
397                 }],
398                 ['os_posix == 1 and OS != "mac"', {
399                     'copies': [{
400                         'destination': '<(PRODUCT_DIR)/plugins',
401                         'files': ['<(PRODUCT_DIR)/libTestNetscapePlugIn.so'],
402                     }],
403                 }],
404             ],
405         },
406     ], # targets
407     'conditions': [
408         ['OS=="win"', {
409             'targets': [{
410                 'target_name': 'LayoutTestHelper',
411                 'type': 'executable',
412                 'sources': ['<(tools_dir)/DumpRenderTree/chromium/LayoutTestHelperWin.cpp'],
413             }],
414         }],
415         ['OS=="mac"', {
416             'targets': [{
417                 'target_name': 'LayoutTestHelper',
418                 'type': 'executable',
419                 'sources': ['<(tools_dir)/DumpRenderTree/chromium/LayoutTestHelper.mm'],
420                 'link_settings': {
421                     'libraries': [
422                         '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
423                     ],
424                 },
425             }],
426         }],
427         ['os_posix==1 and OS!="mac" and gcc_version>=46', {
428             'target_defaults': {
429                 # Disable warnings about c++0x compatibility, as some names (such
430                 # as nullptr) conflict with upcoming c++0x types.
431                 'cflags_cc': ['-Wno-c++0x-compat'],
432             },
433         }],
434         ['OS=="android"', {
435             # Wrap libDumpRenderTree.so into an android apk for execution.
436             'targets': [{
437                 'target_name': 'DumpRenderTree_apk',
438                 'type': 'none',
439                 'dependencies': [
440                     '<(chromium_src_dir)/base/base.gyp:base_java',
441                     '<(chromium_src_dir)/net/net.gyp:net_java',
442                     '<(chromium_src_dir)/media/media.gyp:media_java',
443                     'DumpRenderTree',
444                 ],
445                 'variables': {
446                     'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)DumpRenderTree<(SHARED_LIB_SUFFIX)',
447                     'input_jars_paths': [
448                         '<(PRODUCT_DIR)/lib.java/chromium_base.jar',
449                         '<(PRODUCT_DIR)/lib.java/chromium_net.jar',
450                         '<(PRODUCT_DIR)/lib.java/chromium_media.jar',
451                     ],
452                 },
453                 # Part of the following was copied from <(chromium_src_dir)/build/apk_test.gpyi.
454                 # Not including it because gyp include doesn't support variable in path or under
455                 # conditions. And we also have some different requirements.
456                 'actions': [{
457                     'action_name': 'apk_DumpRenderTree',
458                     'message': 'Building DumpRenderTree test apk.',
459                     'inputs': [
460                         '<(chromium_src_dir)/testing/android/AndroidManifest.xml',
461                         '<(chromium_src_dir)/testing/android/generate_native_test.py',
462                         '<(input_shlib_path)',
463                         '<@(input_jars_paths)',
464                     ],
465                     'outputs': [
466                         '<(PRODUCT_DIR)/DumpRenderTree_apk/DumpRenderTree-debug.apk',
467                     ],
468                     'action': [
469                         '<(chromium_src_dir)/testing/android/generate_native_test.py',
470                         '--native_library',
471                         '<(input_shlib_path)',
472                         '--jars',
473                         '"<@(input_jars_paths)"',
474                         '--output',
475                         '<(PRODUCT_DIR)/DumpRenderTree_apk',
476                         '--ant-args',
477                         '-DPRODUCT_DIR=<(ant_build_out)',
478                         '--ant-compile',
479                         '--app_abi',
480                         '<(android_app_abi)',
481                     ],
482                 }],
483             }],
484         }],
485     ], # conditions
486 }