| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 # Do not add any imports to non-//build directories here. | 5 # Do not add any imports to non-//build directories here. |
| 6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in. | 6 # Some projects (e.g. V8) do not have non-build directories DEPS'ed in. |
| 7 import("//build_overrides/build.gni") | 7 import("//build_overrides/build.gni") |
| 8 import("//build/config/android/config.gni") | 8 import("//build/config/android/config.gni") |
| 9 import("//build/config/sanitizers/sanitizers.gni") | 9 import("//build/config/sanitizers/sanitizers.gni") |
| 10 | 10 |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 rebased_renaming_sources = | 410 rebased_renaming_sources = |
| 411 rebase_path(invoker.renaming_sources, root_build_dir) | 411 rebase_path(invoker.renaming_sources, root_build_dir) |
| 412 args += [ "--renaming-sources=$rebased_renaming_sources" ] | 412 args += [ "--renaming-sources=$rebased_renaming_sources" ] |
| 413 | 413 |
| 414 renaming_destinations = invoker.renaming_destinations | 414 renaming_destinations = invoker.renaming_destinations |
| 415 args += [ "--renaming-destinations=$renaming_destinations" ] | 415 args += [ "--renaming-destinations=$renaming_destinations" ] |
| 416 } | 416 } |
| 417 } | 417 } |
| 418 } | 418 } |
| 419 | 419 |
| 420 template("device_isolate") { |
| 421 testonly = true |
| 422 _runtime_deps_file = "$target_gen_dir/$target_name.runtime_deps" |
| 423 group("${target_name}__write_deps") { |
| 424 forward_variables_from(invoker, |
| 425 [ |
| 426 "data", |
| 427 "data_deps", |
| 428 "deps", |
| 429 "public_deps", |
| 430 ]) |
| 431 write_runtime_deps = _runtime_deps_file |
| 432 } |
| 433 |
| 434 action(target_name) { |
| 435 script = "//build/android/gn/generate_isolate.py" |
| 436 inputs = [ |
| 437 _runtime_deps_file, |
| 438 ] |
| 439 outputs = [ |
| 440 invoker.output, |
| 441 ] |
| 442 args = [ |
| 443 "--output-directory=.", |
| 444 "--out-file", |
| 445 rebase_path(invoker.output, root_build_dir), |
| 446 "--runtime-deps-file", |
| 447 rebase_path(_runtime_deps_file, root_build_dir), |
| 448 "--apply-android-filters", |
| 449 "--apply-device-filters", |
| 450 ] |
| 451 _assert_no_odd_data = |
| 452 defined(invoker.assert_no_odd_data) && invoker.assert_no_odd_data |
| 453 if (_assert_no_odd_data) { |
| 454 args += [ "--assert-no-odd-data" ] |
| 455 } |
| 456 if (defined(invoker.command)) { |
| 457 _isolate_dir = get_path_info(invoker.output, "dir") |
| 458 args += [ |
| 459 "--command", |
| 460 rebase_path(invoker.command, _isolate_dir), |
| 461 ] |
| 462 } |
| 463 deps = [ |
| 464 ":${invoker.target_name}__write_deps", |
| 465 ] |
| 466 } |
| 467 } |
| 468 |
| 420 # Generates a script in the output bin directory which runs the test | 469 # Generates a script in the output bin directory which runs the test |
| 421 # target using the test runner script in build/android/test_runner.py. | 470 # target using the test runner script in build/android/test_runner.py. |
| 422 template("test_runner_script") { | 471 template("test_runner_script") { |
| 423 testonly = true | 472 testonly = true |
| 424 _test_name = invoker.test_name | 473 _test_name = invoker.test_name |
| 425 _test_type = invoker.test_type | 474 _test_type = invoker.test_type |
| 426 _incremental_install = | 475 _incremental_install = |
| 427 defined(invoker.incremental_install) && invoker.incremental_install | 476 defined(invoker.incremental_install) && invoker.incremental_install |
| 428 | 477 |
| 429 _runtime_deps = | |
| 430 !defined(invoker.ignore_all_data_deps) || !invoker.ignore_all_data_deps | |
| 431 | |
| 432 if (_runtime_deps) { | |
| 433 _runtime_deps_file = "$target_gen_dir/$target_name.runtime_deps" | |
| 434 _runtime_deps_target = "${target_name}__write_deps" | |
| 435 group(_runtime_deps_target) { | |
| 436 forward_variables_from(invoker, | |
| 437 [ | |
| 438 "data", | |
| 439 "data_deps", | |
| 440 "deps", | |
| 441 "public_deps", | |
| 442 ]) | |
| 443 write_runtime_deps = _runtime_deps_file | |
| 444 } | |
| 445 } | |
| 446 | |
| 447 action(target_name) { | 478 action(target_name) { |
| 448 forward_variables_from(invoker, | 479 forward_variables_from(invoker, |
| 449 [ | 480 [ |
| 450 "data_deps", | 481 "data_deps", |
| 451 "deps", | 482 "deps", |
| 452 ]) | 483 ]) |
| 453 if (!defined(deps)) { | 484 if (!defined(deps)) { |
| 454 deps = [] | 485 deps = [] |
| 455 } | 486 } |
| 456 if (!defined(data_deps)) { | 487 if (!defined(data_deps)) { |
| 457 data_deps = [] | 488 data_deps = [] |
| 458 } | 489 } |
| 459 | 490 |
| 460 script = "//build/android/gyp/create_test_runner_script.py" | 491 script = "//build/android/gyp/create_test_runner_script.py" |
| 461 depfile = "$target_gen_dir/$target_name.d" | 492 depfile = "$target_gen_dir/$target_name.d" |
| 462 | 493 |
| 463 data_deps += [ "//build/android:test_runner_py" ] | 494 data_deps += [ "//build/android:test_runner_py" ] |
| 464 data = [] | 495 data = [] |
| 465 | 496 |
| 466 test_runner_args = [ | 497 test_runner_args = [ |
| 467 _test_type, | 498 _test_type, |
| 468 "--output-directory", | 499 "--output-directory", |
| 469 rebase_path(root_build_dir, root_build_dir), | 500 rebase_path(root_build_dir, root_build_dir), |
| 470 ] | 501 ] |
| 471 | 502 |
| 472 if (_runtime_deps) { | |
| 473 deps += [ ":$_runtime_deps_target" ] | |
| 474 data += [ _runtime_deps_file ] | |
| 475 test_runner_args += [ | |
| 476 "--runtime-deps-path", | |
| 477 rebase_path(_runtime_deps_file, root_build_dir), | |
| 478 ] | |
| 479 } | |
| 480 | |
| 481 # apk_target is not used for native executable tests | 503 # apk_target is not used for native executable tests |
| 482 # (e.g. breakpad_unittests). | 504 # (e.g. breakpad_unittests). |
| 483 if (defined(invoker.apk_target)) { | 505 if (defined(invoker.apk_target)) { |
| 484 assert(!defined(invoker.executable_dist_dir)) | 506 assert(!defined(invoker.executable_dist_dir)) |
| 485 deps += [ "${invoker.apk_target}__build_config" ] | 507 deps += [ "${invoker.apk_target}__build_config" ] |
| 486 _apk_build_config = | 508 _apk_build_config = |
| 487 get_label_info(invoker.apk_target, "target_gen_dir") + "/" + | 509 get_label_info(invoker.apk_target, "target_gen_dir") + "/" + |
| 488 get_label_info(invoker.apk_target, "name") + ".build_config" | 510 get_label_info(invoker.apk_target, "name") + ".build_config" |
| 489 _rebased_apk_build_config = rebase_path(_apk_build_config, root_build_dir) | 511 _rebased_apk_build_config = rebase_path(_apk_build_config, root_build_dir) |
| 490 assert(_rebased_apk_build_config != "") # Mark as used. | 512 assert(_rebased_apk_build_config != "") # Mark as used. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 deps += [ "${additional_apk}__build_config" ] | 569 deps += [ "${additional_apk}__build_config" ] |
| 548 _build_config = get_label_info(additional_apk, "target_gen_dir") + "/" + | 570 _build_config = get_label_info(additional_apk, "target_gen_dir") + "/" + |
| 549 get_label_info(additional_apk, "name") + ".build_config" | 571 get_label_info(additional_apk, "name") + ".build_config" |
| 550 _rebased_build_config = rebase_path(_build_config, root_build_dir) | 572 _rebased_build_config = rebase_path(_build_config, root_build_dir) |
| 551 test_runner_args += [ | 573 test_runner_args += [ |
| 552 "--additional-apk", | 574 "--additional-apk", |
| 553 "@FileArg($_rebased_build_config:deps_info:apk_path)", | 575 "@FileArg($_rebased_build_config:deps_info:apk_path)", |
| 554 ] | 576 ] |
| 555 } | 577 } |
| 556 } | 578 } |
| 579 if (defined(invoker.isolate_file)) { |
| 580 data += [ invoker.isolate_file ] |
| 581 test_runner_args += [ |
| 582 "--isolate-file-path", |
| 583 rebase_path(invoker.isolate_file, root_build_dir), |
| 584 ] |
| 585 } |
| 557 if (defined(invoker.shard_timeout)) { | 586 if (defined(invoker.shard_timeout)) { |
| 558 test_runner_args += [ "--shard-timeout=${invoker.shard_timeout}" ] | 587 test_runner_args += [ "--shard-timeout=${invoker.shard_timeout}" ] |
| 559 } | 588 } |
| 560 if (_incremental_install) { | 589 if (_incremental_install) { |
| 561 test_runner_args += [ | 590 test_runner_args += [ |
| 562 "--test-apk-incremental-install-script", | 591 "--test-apk-incremental-install-script", |
| 563 "@FileArg($_rebased_apk_build_config:deps_info:incremental_install_scrip
t_path)", | 592 "@FileArg($_rebased_apk_build_config:deps_info:incremental_install_scrip
t_path)", |
| 564 ] | 593 ] |
| 565 if (defined(invoker.apk_under_test)) { | 594 if (defined(invoker.apk_under_test)) { |
| 566 test_runner_args += [ | 595 test_runner_args += [ |
| (...skipping 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2677 rebase_path(root_build_dir, root_build_dir), | 2706 rebase_path(root_build_dir, root_build_dir), |
| 2678 "--packed-libraries-dir", | 2707 "--packed-libraries-dir", |
| 2679 rebase_path(_packed_libraries_dir, root_build_dir), | 2708 rebase_path(_packed_libraries_dir, root_build_dir), |
| 2680 "--libraries=${invoker.libraries_filearg}", | 2709 "--libraries=${invoker.libraries_filearg}", |
| 2681 "--filelistjson", | 2710 "--filelistjson", |
| 2682 rebase_path(invoker.file_list_json, root_build_dir), | 2711 rebase_path(invoker.file_list_json, root_build_dir), |
| 2683 ] | 2712 ] |
| 2684 } | 2713 } |
| 2685 } | 2714 } |
| 2686 } | 2715 } |
| OLD | NEW |