blob: 3387c3674b304731f048a4efb724797dd072f3c6 [file] [log] [blame]
kjellander@webrtc.org2a973172013-10-02 19:31:16 +00001# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
9# Copied from Chromium's src/build/isolate.gypi
10#
11# It was necessary to copy this file to WebRTC, because the path to
12# build/common.gypi is different for the standalone and Chromium builds. Gyp
13# doesn't permit conditional inclusion or variable expansion in include paths.
14# http://code.google.com/p/gyp/wiki/InputFormatReference#Including_Other_Files
kjellander@webrtc.org607c8052014-02-09 18:38:31 +000015#
16# Local modifications:
17# * Removed include of '../chrome/version.gypi'.
18# * Removal passing of version_full variable created in version.gypi:
19# '--extra-variable', 'version_full=<(version_full)',
kjellander@webrtc.org2a973172013-10-02 19:31:16 +000020
21# This file is meant to be included into a target to provide a rule
22# to "build" .isolate files into a .isolated file.
23#
24# To use this, create a gyp target with the following form:
25# 'conditions': [
26# ['test_isolation_mode != "noop"', {
27# 'targets': [
28# {
29# 'target_name': 'foo_test_run',
30# 'type': 'none',
31# 'dependencies': [
32# 'foo_test',
33# ],
34# 'includes': [
35# '../build/isolate.gypi',
36# 'foo_test.isolate',
37# ],
38# 'sources': [
39# 'foo_test.isolate',
40# ],
41# },
42# ],
43# }],
44# ],
45#
46# Note: foo_test.isolate is included and a source file. It is an inherent
47# property of the .isolate format. This permits to define GYP variables but is
48# a stricter format than GYP so isolate.py can read it.
49#
50# The generated .isolated file will be:
51# <(PRODUCT_DIR)/foo_test.isolated
kjellander@webrtc.org607c8052014-02-09 18:38:31 +000052#
53# See http://dev.chromium.org/developers/testing/isolated-testing/for-swes
54# for more information.
kjellander@webrtc.org2a973172013-10-02 19:31:16 +000055
56{
57 'rules': [
58 {
59 'rule_name': 'isolate',
60 'extension': 'isolate',
61 'inputs': [
62 # Files that are known to be involved in this step.
kjellander@webrtc.orgf9bdbe32013-12-11 13:37:12 +000063 '<(DEPTH)/tools/swarming_client/isolate.py',
64 '<(DEPTH)/tools/swarming_client/run_isolated.py',
kjellander@webrtc.org2a973172013-10-02 19:31:16 +000065
66 # Disable file tracking by the build driver for now. This means the
67 # project must have the proper build-time dependency for their runtime
68 # dependency. This improves the runtime of the build driver since it
69 # doesn't have to stat() all these files.
70 #
71 # More importantly, it means that even if a isolate_dependency_tracked
72 # file is missing, for example if a file was deleted and the .isolate
73 # file was not updated, that won't break the build, especially in the
74 # case where foo_tests_run is not built! This should be reenabled once
75 # the switch-over to running tests on Swarm is completed.
76 #'<@(isolate_dependency_tracked)',
77 ],
78 'outputs': [
79 '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated',
80 ],
kjellander@webrtc.org607c8052014-02-09 18:38:31 +000081 'action': [
82 'python',
83 '<(DEPTH)/tools/swarming_client/isolate.py',
84 '<(test_isolation_mode)',
85 '--result', '<@(_outputs)',
86 '--isolate', '<(RULE_INPUT_PATH)',
87
88 # Variables should use the -V FOO=<(FOO) form so frequent values,
89 # like '0' or '1', aren't stripped out by GYP. Run 'isolate.py help' for
90 # more details.
91 #
92 # This list needs to be kept in sync with the cmd line options
93 # in src/build/android/pylib/gtest/setup.py.
94
95 # Path variables are used to replace file paths when loading a .isolate
96 # file
97 '--path-variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ',
98
99 '--config-variable', 'OS=<(OS)',
100 '--config-variable', 'chromeos=<(chromeos)',
101 '--config-variable', 'component=<(component)',
102 # TODO(kbr): move this to chrome_tests.gypi:gles2_conform_tests_run
103 # once support for user-defined config variables is added.
104 '--config-variable',
105 'internal_gles2_conform_tests=<(internal_gles2_conform_tests)',
106 '--config-variable', 'icu_use_data_file_flag=<(icu_use_data_file_flag)',
107 '--config-variable', 'use_openssl=<(use_openssl)',
108 ],
kjellander@webrtc.org2a973172013-10-02 19:31:16 +0000109 'conditions': [
kjellander@webrtc.org607c8052014-02-09 18:38:31 +0000110 # Note: When gyp merges lists, it appends them to the old value.
111 ['OS=="mac"', {
112 # <(mac_product_name) can contain a space, so don't use FOO=<(FOO)
113 # form.
kjellander@webrtc.org2a973172013-10-02 19:31:16 +0000114 'action': [
kjellander@webrtc.org607c8052014-02-09 18:38:31 +0000115 '--extra-variable', 'mac_product_name', '<(mac_product_name)',
kjellander@webrtc.org2a973172013-10-02 19:31:16 +0000116 ],
117 }],
kjellander@webrtc.org607c8052014-02-09 18:38:31 +0000118 ["test_isolation_outdir!=''", {
119 'action': [ '--isolate-server', '<(test_isolation_outdir)' ],
120 }],
kjellander@webrtc.org2a973172013-10-02 19:31:16 +0000121 ['test_isolation_fail_on_missing == 0', {
kjellander@webrtc.org607c8052014-02-09 18:38:31 +0000122 'action': ['--ignore_broken_items'],
123 }],
kjellander@webrtc.org2a973172013-10-02 19:31:16 +0000124 ],
kjellander@webrtc.org2a973172013-10-02 19:31:16 +0000125 },
126 ],
127}