forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.gn
213 lines (186 loc) · 5.91 KB
/
BUILD.gn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chrome_build.gni")
import("//testing/test.gni")
# Convenience meta-target for all of Blimp's production & test code.
group("blimp") {
# In spite of the name, this really just means that non-test targets
# cannot depend on this one, and that it can depend on test targets,
# which fits how we intend to use it.
testonly = true
deps = [
":blimp_tests",
"//blimp/client",
"//blimp/common",
]
if (is_linux) {
deps += [
":client_engine_integration",
"//blimp/engine",
"//blimp/engine:blimp_engine_bundle",
]
if (is_official_build) {
deps += [ "//blimp/engine:blimp_symbols" ]
}
}
}
# Builds all Blimp test code (unit tests, test APKs).
group("blimp_tests") {
testonly = true
deps = [
":blimp_unittests",
"//blimp/client:test_binaries",
]
if (is_linux) {
deps += [
":blimp_browsertests",
"//blimp/test/fake_engine:fake_engine_app_tests",
]
}
}
test("blimp_unittests") {
deps = [
"//blimp/client:unit_tests",
"//blimp/common:unit_tests",
"//blimp/helium:unit_tests",
"//blimp/net:unit_tests",
"//blimp/test:run_all_unittests",
]
if (is_linux) {
deps += [ "//blimp/engine:unit_tests" ]
}
if (is_android) {
deps += [ "//blimp/client:blimp_unittests_java_deps" ]
}
}
if (is_linux) {
test("blimp_browsertests") {
deps = [
"//blimp/engine:browser_tests",
"//tools/xdisplaycheck",
]
data = [
"test/data/",
]
}
_blimp_engine_env_tests_runtime_deps =
"$root_gen_dir/blimp-tests.runtime_deps"
_rebased_blimp_engine_env_tests_runtime_deps =
rebase_path(_blimp_engine_env_tests_runtime_deps, root_out_dir)
# This group contains Blimp Engine tests and tests of the various components
# the Blimp Engine depends on. The idea is that if this group of tests pass
# on a given system there is a high probability the Engine will also work on
# that platform.
group("blimp_engine_env_tests_group") {
testonly = true
# Additional environment test targets should be added here.
# Executable targets and those executable targets' transitive
# dependencies are not considered unless that executable is listed in
# "data_deps". Otherwise, GN assumes that the executable (and
# everything it requires) is a build-time dependency only.
data_deps = [
":blimp_browsertests",
":blimp_unittests",
"//base:base_unittests",
"//breakpad:generate_test_dump",
"//content/test:content_unittests",
"//ipc:ipc_tests",
"//net:net_unittests",
"//sandbox/linux:sandbox_linux_unittests",
"//blimp/test/fake_engine:fake_engine_app",
]
write_runtime_deps = _blimp_engine_env_tests_runtime_deps
}
_blimp_engine_env_tests_manifest = "$root_gen_dir/blimp-tests-manifest.txt"
_rebased_blimp_engine_env_tests_manifest =
rebase_path(_blimp_engine_env_tests_manifest, root_out_dir)
_rebased_blimp_engine_env_tests_blacklist =
rebase_path("//blimp/tools/tests-manifest-blacklist.txt")
action("generate_blimp_engine_env_tests_manifest") {
testonly = true
script = "//blimp/tools/generate-target-manifest.py"
args = [
"--blacklist",
_rebased_blimp_engine_env_tests_blacklist,
"--runtime-deps-file",
_rebased_blimp_engine_env_tests_runtime_deps,
"--output",
_rebased_blimp_engine_env_tests_manifest,
]
inputs = [
_rebased_blimp_engine_env_tests_blacklist,
_blimp_engine_env_tests_runtime_deps,
]
outputs = [
_blimp_engine_env_tests_manifest,
]
# By specifying a dependency (not a data_dependency) on :blimp_tests_group,
# we can be sure that everything is built before the action is
# complete (though not necessarily before we generate the manifest
# itself).
deps = [
":blimp_engine_env_tests_group",
]
}
# Builds and bundles the tests into a tarball that can be used to build a
# Docker image.
action("blimp_engine_env_tests_bundle") {
testonly = true
script = "//blimp/tools/create-bundle.py"
# These form the arguments to the script.
_rebased_out_dir = rebase_path(root_out_dir)
_rebased_dockerfile = rebase_path("//blimp/engine/testing/Dockerfile")
_rebased_dockerfile_base = rebase_path("//blimp/tools/Dockerfile.base")
_bundle = "$root_out_dir/blimp_engine_env_tests_bundle.tar.gz"
# Depending on this ensures that both the manifest is generated
# and everything listed in the manifest has been built.
deps = [
":generate_blimp_engine_env_tests_manifest",
]
sources = [
_blimp_engine_env_tests_manifest,
_rebased_dockerfile,
_rebased_dockerfile_base,
]
outputs = [
_bundle,
]
args = [
"--build-dir",
_rebased_out_dir,
"--filelist",
_rebased_dockerfile,
_rebased_dockerfile_base,
"--manifest",
_rebased_blimp_engine_env_tests_manifest,
"--output",
rebase_path(_bundle),
"--tar-contents-rooted-in",
rebase_path("//"),
]
}
# Wraps and Builds the Blimp client and engine integration script and
# ends up in root_out_dir/bin.
action("client_engine_integration") {
_wrapped_script = "//blimp/tools/client_engine_integration.py"
_script_basename = get_path_info(_wrapped_script, "name")
_output_path = "${root_out_dir}/bin/${_script_basename}"
script = "//build/android/gyp/create_tool_wrapper.py"
inputs = [
_wrapped_script,
]
outputs = [
_output_path,
]
args = [
"--output",
rebase_path(_output_path, root_build_dir),
"--target",
rebase_path(_wrapped_script, root_build_dir),
"--output-directory",
rebase_path(root_out_dir, root_build_dir),
"--flag-name=--output-linux-directory",
]
}
}