Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Side by Side Diff: testing/test.gni

Issue 2692273008: Hacky slashy (Closed)
Patch Set: . Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # ============================================================================== 5 # ==============================================================================
6 # TEST SETUP 6 # TEST SETUP
7 # ============================================================================== 7 # ==============================================================================
8 8
9 if (is_android) { 9 if (is_android) {
10 import("//build/config/android/config.gni") 10 import("//build/config/android/config.gni")
11 import("//build/config/android/rules.gni") 11 import("//build/config/android/rules.gni")
12 import("//build/config/sanitizers/sanitizers.gni") 12 import("//build/config/sanitizers/sanitizers.gni")
13 } 13 }
14 14
15 if (is_fuchsia) {
16 import("//build/config/fuchsia/rules.gni")
17 }
18
15 # Define a test as an executable (or apk on Android) with the "testonly" flag 19 # Define a test as an executable (or apk on Android) with the "testonly" flag
16 # set. 20 # set.
17 # Variable: 21 # Variable:
18 # use_raw_android_executable: Use executable() rather than android_apk(). 22 # use_raw_android_executable: Use executable() rather than android_apk().
19 # use_native_activity: Test implements ANativeActivity_onCreate(). 23 # use_native_activity: Test implements ANativeActivity_onCreate().
20 template("test") { 24 template("test") {
21 if (is_android) { 25 if (is_android) {
22 _use_raw_android_executable = defined(invoker.use_raw_android_executable) && 26 _use_raw_android_executable = defined(invoker.use_raw_android_executable) &&
23 invoker.use_raw_android_executable 27 invoker.use_raw_android_executable
24 28
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 # All shared libraries must have the sanitizer deps to properly link in 267 # All shared libraries must have the sanitizer deps to properly link in
264 # asan mode (this target will be empty in other cases). 268 # asan mode (this target will be empty in other cases).
265 "//build/config/sanitizers:deps", 269 "//build/config/sanitizers:deps",
266 ] 270 ]
267 if (!defined(bundle_deps)) { 271 if (!defined(bundle_deps)) {
268 bundle_deps = [] 272 bundle_deps = []
269 } 273 }
270 bundle_deps += [ ":$_resources_bundle_data" ] 274 bundle_deps += [ ":$_resources_bundle_data" ]
271 } 275 }
272 } else { 276 } else {
277 if (is_fuchsia) {
278 _output_name = invoker.target_name
279 _test_runner_target = "${_output_name}__test_runner_script"
280
281 test_runner_script(_test_runner_target) {
282 forward_variables_from(invoker,
283 [
284 "data",
285 "data_deps",
286 "deps",
287 "public_deps",
288 ])
289 test_name = _output_name
290 }
291 }
292
273 executable(target_name) { 293 executable(target_name) {
274 deps = [] 294 deps = []
295 data_deps = []
275 forward_variables_from(invoker, "*") 296 forward_variables_from(invoker, "*")
276 297
277 testonly = true 298 testonly = true
278 deps += [ 299 deps += [
279 # All shared libraries must have the sanitizer deps to properly link in 300 # All shared libraries must have the sanitizer deps to properly link in
280 # asan mode (this target will be empty in other cases). 301 # asan mode (this target will be empty in other cases).
281 "//build/config/sanitizers:deps", 302 "//build/config/sanitizers:deps",
282 303
283 # Give tests the default manifest on Windows (a no-op elsewhere). 304 # Give tests the default manifest on Windows (a no-op elsewhere).
284 "//build/win:default_exe_manifest", 305 "//build/win:default_exe_manifest",
285 ] 306 ]
307
308 if (is_fuchsia) {
309 data_deps += [ ":$_test_runner_target" ]
310 }
286 } 311 }
287 312
288 # TODO(GYP_GONE): Delete this after we've converted everything to GN. 313 # TODO(GYP_GONE): Delete this after we've converted everything to GN.
289 # The _run targets exist only for compatibility with GYP. 314 # The _run targets exist only for compatibility with GYP.
290 group("${target_name}_run") { 315 group("${target_name}_run") {
291 testonly = true 316 testonly = true
292 deps = [ 317 deps = [
293 ":${invoker.target_name}", 318 ":${invoker.target_name}",
294 ] 319 ]
295 } 320 }
(...skipping 10 matching lines...) Expand all
306 } 331 }
307 332
308 # Test defaults. 333 # Test defaults.
309 set_defaults("test") { 334 set_defaults("test") {
310 if (is_android) { 335 if (is_android) {
311 configs = default_shared_library_configs 336 configs = default_shared_library_configs
312 } else { 337 } else {
313 configs = default_executable_configs 338 configs = default_executable_configs
314 } 339 }
315 } 340 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698