| OLD | NEW |
| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 # All shared libraries must have the sanitizer deps to properly link in | 279 # All shared libraries must have the sanitizer deps to properly link in |
| 276 # asan mode (this target will be empty in other cases). | 280 # asan mode (this target will be empty in other cases). |
| 277 "//build/config/sanitizers:deps", | 281 "//build/config/sanitizers:deps", |
| 278 ] | 282 ] |
| 279 if (!defined(bundle_deps)) { | 283 if (!defined(bundle_deps)) { |
| 280 bundle_deps = [] | 284 bundle_deps = [] |
| 281 } | 285 } |
| 282 bundle_deps += [ ":$_resources_bundle_data" ] | 286 bundle_deps += [ ":$_resources_bundle_data" ] |
| 283 } | 287 } |
| 284 } else { | 288 } else { |
| 289 if (is_fuchsia) { |
| 290 _output_name = invoker.target_name |
| 291 _test_runner_target = "${_output_name}__test_runner_script" |
| 292 |
| 293 test_runner_script(_test_runner_target) { |
| 294 forward_variables_from(invoker, |
| 295 [ |
| 296 "data", |
| 297 "data_deps", |
| 298 "deps", |
| 299 "public_deps", |
| 300 ]) |
| 301 test_name = _output_name |
| 302 } |
| 303 } |
| 304 |
| 285 executable(target_name) { | 305 executable(target_name) { |
| 286 deps = [] | 306 deps = [] |
| 307 data_deps = [] |
| 287 forward_variables_from(invoker, "*") | 308 forward_variables_from(invoker, "*") |
| 288 | 309 |
| 289 testonly = true | 310 testonly = true |
| 290 deps += [ | 311 deps += [ |
| 291 # All shared libraries must have the sanitizer deps to properly link in | 312 # All shared libraries must have the sanitizer deps to properly link in |
| 292 # asan mode (this target will be empty in other cases). | 313 # asan mode (this target will be empty in other cases). |
| 293 "//build/config/sanitizers:deps", | 314 "//build/config/sanitizers:deps", |
| 294 | 315 |
| 295 # Give tests the default manifest on Windows (a no-op elsewhere). | 316 # Give tests the default manifest on Windows (a no-op elsewhere). |
| 296 "//build/win:default_exe_manifest", | 317 "//build/win:default_exe_manifest", |
| 297 ] | 318 ] |
| 319 |
| 320 if (is_fuchsia) { |
| 321 data_deps += [ ":$_test_runner_target" ] |
| 322 } |
| 298 } | 323 } |
| 299 } | 324 } |
| 300 } | 325 } |
| 301 | 326 |
| 302 # Test defaults. | 327 # Test defaults. |
| 303 set_defaults("test") { | 328 set_defaults("test") { |
| 304 if (is_android) { | 329 if (is_android) { |
| 305 configs = default_shared_library_configs | 330 configs = default_shared_library_configs |
| 306 } else { | 331 } else { |
| 307 configs = default_executable_configs | 332 configs = default_executable_configs |
| 308 } | 333 } |
| 309 } | 334 } |
| OLD | NEW |