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 # This runtime_deps file is used at runtime and thus cannot go in |
| 434 # target_gen_dir. |
| 435 _target_dir_name = get_label_info(":$target_name", "dir") |
| 436 _runtime_deps_file = |
| 437 "$root_out_dir/gen.runtime/$_target_dir_name/$target_name.runtime_deps" |
| 438 _runtime_deps_target = "${target_name}__write_deps" |
| 439 group(_runtime_deps_target) { |
| 440 forward_variables_from(invoker, |
| 441 [ |
| 442 "data", |
| 443 "data_deps", |
| 444 "deps", |
| 445 "public_deps", |
| 446 ]) |
| 447 write_runtime_deps = _runtime_deps_file |
| 448 } |
| 449 } |
| 450 |
478 action(target_name) { | 451 action(target_name) { |
479 forward_variables_from(invoker, | 452 forward_variables_from(invoker, |
480 [ | 453 [ |
481 "data_deps", | 454 "data_deps", |
482 "deps", | 455 "deps", |
483 ]) | 456 ]) |
484 if (!defined(deps)) { | 457 if (!defined(deps)) { |
485 deps = [] | 458 deps = [] |
486 } | 459 } |
487 if (!defined(data_deps)) { | 460 if (!defined(data_deps)) { |
488 data_deps = [] | 461 data_deps = [] |
489 } | 462 } |
490 | 463 |
491 script = "//build/android/gyp/create_test_runner_script.py" | 464 script = "//build/android/gyp/create_test_runner_script.py" |
492 depfile = "$target_gen_dir/$target_name.d" | 465 depfile = "$target_gen_dir/$target_name.d" |
493 | 466 |
494 data_deps += [ "//build/android:test_runner_py" ] | 467 data_deps += [ "//build/android:test_runner_py" ] |
495 data = [] | 468 data = [] |
496 | 469 |
497 test_runner_args = [ | 470 test_runner_args = [ |
498 _test_type, | 471 _test_type, |
499 "--output-directory", | 472 "--output-directory", |
500 rebase_path(root_build_dir, root_build_dir), | 473 rebase_path(root_build_dir, root_build_dir), |
501 ] | 474 ] |
502 | 475 |
| 476 if (_runtime_deps) { |
| 477 deps += [ ":$_runtime_deps_target" ] |
| 478 data += [ _runtime_deps_file ] |
| 479 test_runner_args += [ |
| 480 "--runtime-deps-path", |
| 481 rebase_path(_runtime_deps_file, root_build_dir), |
| 482 ] |
| 483 } |
| 484 |
503 # apk_target is not used for native executable tests | 485 # apk_target is not used for native executable tests |
504 # (e.g. breakpad_unittests). | 486 # (e.g. breakpad_unittests). |
505 if (defined(invoker.apk_target)) { | 487 if (defined(invoker.apk_target)) { |
506 assert(!defined(invoker.executable_dist_dir)) | 488 assert(!defined(invoker.executable_dist_dir)) |
507 deps += [ "${invoker.apk_target}__build_config" ] | 489 deps += [ "${invoker.apk_target}__build_config" ] |
508 _apk_build_config = | 490 _apk_build_config = |
509 get_label_info(invoker.apk_target, "target_gen_dir") + "/" + | 491 get_label_info(invoker.apk_target, "target_gen_dir") + "/" + |
510 get_label_info(invoker.apk_target, "name") + ".build_config" | 492 get_label_info(invoker.apk_target, "name") + ".build_config" |
511 _rebased_apk_build_config = rebase_path(_apk_build_config, root_build_dir) | 493 _rebased_apk_build_config = rebase_path(_apk_build_config, root_build_dir) |
512 assert(_rebased_apk_build_config != "") # Mark as used. | 494 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" ] | 551 deps += [ "${additional_apk}__build_config" ] |
570 _build_config = get_label_info(additional_apk, "target_gen_dir") + "/" + | 552 _build_config = get_label_info(additional_apk, "target_gen_dir") + "/" + |
571 get_label_info(additional_apk, "name") + ".build_config" | 553 get_label_info(additional_apk, "name") + ".build_config" |
572 _rebased_build_config = rebase_path(_build_config, root_build_dir) | 554 _rebased_build_config = rebase_path(_build_config, root_build_dir) |
573 test_runner_args += [ | 555 test_runner_args += [ |
574 "--additional-apk", | 556 "--additional-apk", |
575 "@FileArg($_rebased_build_config:deps_info:apk_path)", | 557 "@FileArg($_rebased_build_config:deps_info:apk_path)", |
576 ] | 558 ] |
577 } | 559 } |
578 } | 560 } |
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)) { | 561 if (defined(invoker.shard_timeout)) { |
587 test_runner_args += [ "--shard-timeout=${invoker.shard_timeout}" ] | 562 test_runner_args += [ "--shard-timeout=${invoker.shard_timeout}" ] |
588 } | 563 } |
589 if (_incremental_install) { | 564 if (_incremental_install) { |
590 test_runner_args += [ | 565 test_runner_args += [ |
591 "--test-apk-incremental-install-script", | 566 "--test-apk-incremental-install-script", |
592 "@FileArg($_rebased_apk_build_config:deps_info:incremental_install_scrip
t_path)", | 567 "@FileArg($_rebased_apk_build_config:deps_info:incremental_install_scrip
t_path)", |
593 ] | 568 ] |
594 if (defined(invoker.apk_under_test)) { | 569 if (defined(invoker.apk_under_test)) { |
595 test_runner_args += [ | 570 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), | 2681 rebase_path(root_build_dir, root_build_dir), |
2707 "--packed-libraries-dir", | 2682 "--packed-libraries-dir", |
2708 rebase_path(_packed_libraries_dir, root_build_dir), | 2683 rebase_path(_packed_libraries_dir, root_build_dir), |
2709 "--libraries=${invoker.libraries_filearg}", | 2684 "--libraries=${invoker.libraries_filearg}", |
2710 "--filelistjson", | 2685 "--filelistjson", |
2711 rebase_path(invoker.file_list_json, root_build_dir), | 2686 rebase_path(invoker.file_list_json, root_build_dir), |
2712 ] | 2687 ] |
2713 } | 2688 } |
2714 } | 2689 } |
2715 } | 2690 } |
OLD | NEW |