| 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 | |
| 469 # Generates a script in the output bin directory which runs the test | 420 # Generates a script in the output bin directory which runs the test |
| 470 # target using the test runner script in build/android/test_runner.py. | 421 # target using the test runner script in build/android/test_runner.py. |
| 471 template("test_runner_script") { | 422 template("test_runner_script") { |
| 472 testonly = true | 423 testonly = true |
| 473 _test_name = invoker.test_name | 424 _test_name = invoker.test_name |
| 474 _test_type = invoker.test_type | 425 _test_type = invoker.test_type |
| 475 _incremental_install = | 426 _incremental_install = |
| 476 defined(invoker.incremental_install) && invoker.incremental_install | 427 defined(invoker.incremental_install) && invoker.incremental_install |
| 477 | 428 |
| 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 |
| 478 action(target_name) { | 447 action(target_name) { |
| 479 forward_variables_from(invoker, | 448 forward_variables_from(invoker, |
| 480 [ | 449 [ |
| 481 "data_deps", | 450 "data_deps", |
| 482 "deps", | 451 "deps", |
| 483 ]) | 452 ]) |
| 484 if (!defined(deps)) { | 453 if (!defined(deps)) { |
| 485 deps = [] | 454 deps = [] |
| 486 } | 455 } |
| 487 if (!defined(data_deps)) { | 456 if (!defined(data_deps)) { |
| 488 data_deps = [] | 457 data_deps = [] |
| 489 } | 458 } |
| 490 | 459 |
| 491 script = "//build/android/gyp/create_test_runner_script.py" | 460 script = "//build/android/gyp/create_test_runner_script.py" |
| 492 depfile = "$target_gen_dir/$target_name.d" | 461 depfile = "$target_gen_dir/$target_name.d" |
| 493 | 462 |
| 494 data_deps += [ "//build/android:test_runner_py" ] | 463 data_deps += [ "//build/android:test_runner_py" ] |
| 495 data = [] | 464 data = [] |
| 496 | 465 |
| 497 test_runner_args = [ | 466 test_runner_args = [ |
| 498 _test_type, | 467 _test_type, |
| 499 "--output-directory", | 468 "--output-directory", |
| 500 rebase_path(root_build_dir, root_build_dir), | 469 rebase_path(root_build_dir, root_build_dir), |
| 501 ] | 470 ] |
| 502 | 471 |
| 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 |
| 503 # apk_target is not used for native executable tests | 481 # apk_target is not used for native executable tests |
| 504 # (e.g. breakpad_unittests). | 482 # (e.g. breakpad_unittests). |
| 505 if (defined(invoker.apk_target)) { | 483 if (defined(invoker.apk_target)) { |
| 506 assert(!defined(invoker.executable_dist_dir)) | 484 assert(!defined(invoker.executable_dist_dir)) |
| 507 deps += [ "${invoker.apk_target}__build_config" ] | 485 deps += [ "${invoker.apk_target}__build_config" ] |
| 508 _apk_build_config = | 486 _apk_build_config = |
| 509 get_label_info(invoker.apk_target, "target_gen_dir") + "/" + | 487 get_label_info(invoker.apk_target, "target_gen_dir") + "/" + |
| 510 get_label_info(invoker.apk_target, "name") + ".build_config" | 488 get_label_info(invoker.apk_target, "name") + ".build_config" |
| 511 _rebased_apk_build_config = rebase_path(_apk_build_config, root_build_dir) | 489 _rebased_apk_build_config = rebase_path(_apk_build_config, root_build_dir) |
| 512 assert(_rebased_apk_build_config != "") # Mark as used. | 490 assert(_rebased_apk_build_config != "") # Mark as used. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 deps += [ "${additional_apk}__build_config" ] | 547 deps += [ "${additional_apk}__build_config" ] |
| 570 _build_config = get_label_info(additional_apk, "target_gen_dir") + "/" + | 548 _build_config = get_label_info(additional_apk, "target_gen_dir") + "/" + |
| 571 get_label_info(additional_apk, "name") + ".build_config" | 549 get_label_info(additional_apk, "name") + ".build_config" |
| 572 _rebased_build_config = rebase_path(_build_config, root_build_dir) | 550 _rebased_build_config = rebase_path(_build_config, root_build_dir) |
| 573 test_runner_args += [ | 551 test_runner_args += [ |
| 574 "--additional-apk", | 552 "--additional-apk", |
| 575 "@FileArg($_rebased_build_config:deps_info:apk_path)", | 553 "@FileArg($_rebased_build_config:deps_info:apk_path)", |
| 576 ] | 554 ] |
| 577 } | 555 } |
| 578 } | 556 } |
| 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 } | |
| 586 if (defined(invoker.shard_timeout)) { | 557 if (defined(invoker.shard_timeout)) { |
| 587 test_runner_args += [ "--shard-timeout=${invoker.shard_timeout}" ] | 558 test_runner_args += [ "--shard-timeout=${invoker.shard_timeout}" ] |
| 588 } | 559 } |
| 589 if (_incremental_install) { | 560 if (_incremental_install) { |
| 590 test_runner_args += [ | 561 test_runner_args += [ |
| 591 "--test-apk-incremental-install-script", | 562 "--test-apk-incremental-install-script", |
| 592 "@FileArg($_rebased_apk_build_config:deps_info:incremental_install_scrip
t_path)", | 563 "@FileArg($_rebased_apk_build_config:deps_info:incremental_install_scrip
t_path)", |
| 593 ] | 564 ] |
| 594 if (defined(invoker.apk_under_test)) { | 565 if (defined(invoker.apk_under_test)) { |
| 595 test_runner_args += [ | 566 test_runner_args += [ |
| (...skipping 2110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2706 rebase_path(root_build_dir, root_build_dir), | 2677 rebase_path(root_build_dir, root_build_dir), |
| 2707 "--packed-libraries-dir", | 2678 "--packed-libraries-dir", |
| 2708 rebase_path(_packed_libraries_dir, root_build_dir), | 2679 rebase_path(_packed_libraries_dir, root_build_dir), |
| 2709 "--libraries=${invoker.libraries_filearg}", | 2680 "--libraries=${invoker.libraries_filearg}", |
| 2710 "--filelistjson", | 2681 "--filelistjson", |
| 2711 rebase_path(invoker.file_list_json, root_build_dir), | 2682 rebase_path(invoker.file_list_json, root_build_dir), |
| 2712 ] | 2683 ] |
| 2713 } | 2684 } |
| 2714 } | 2685 } |
| 2715 } | 2686 } |
| OLD | NEW |