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

Side by Side Diff: build/config/android/internal_rules.gni

Issue 2767613002: Expose resources in Robolectric/JUnit tests. (Closed)
Patch Set: Rough draft for using build_config to find resources. Created 3 years, 8 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 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/dcheck_always_on.gni") 9 import("//build/config/dcheck_always_on.gni")
10 import("//build/config/sanitizers/sanitizers.gni") 10 import("//build/config/sanitizers/sanitizers.gni")
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 "--coverage-dir", 561 "--coverage-dir",
562 rebase_path("$root_out_dir/coverage", root_build_dir), 562 rebase_path("$root_out_dir/coverage", root_build_dir),
563 ] 563 ]
564 } 564 }
565 } else if (_test_type == "junit") { 565 } else if (_test_type == "junit") {
566 assert(defined(invoker.test_suite)) 566 assert(defined(invoker.test_suite))
567 test_runner_args += [ 567 test_runner_args += [
568 "--test-suite", 568 "--test-suite",
569 invoker.test_suite, 569 invoker.test_suite,
570 ] 570 ]
571 if (defined(invoker.android_manifest_path)) {
572 test_runner_args += [
573 "--android-manifest-path",
574 rebase_path(invoker.android_manifest_path, root_build_dir),
575 ]
576 }
577 if (defined(invoker.resource_deps)) {
578 foreach(resource_dep, invoker.resource_deps) {
579 _dep_gen_dir = get_label_info(resource_dep, "target_gen_dir")
580 _dep_name = get_label_info(resource_dep, "name")
581 _rebased_build_config = rebase_path("$_dep_gen_dir/$_dep_name.build_ config", root_build_dir)
582 test_runner_args += [ "--resource-dirs=@FileArg($_rebased_build_conf ig:deps_info:resources_dirs)" ]
583 }
584
585 # foreach(resource_dir, invoker.resource_dirs) {
586 # test_runner_args += [
587 # "--resource-dir",
588 # rebase_path(resource_dir, root_build_dir),
589 # ]
590 # }
591 }
592 if (defined(invoker.package_name)) {
593 test_runner_args += [
594 "--package-name",
595 invoker.package_name,
596 ]
597 }
598 test_runner_args += [
599 "--robolectric-runtime-deps-dir",
600 rebase_path("$root_build_dir/lib.java/third_party/robolectric",
601 root_build_dir),
602 ]
571 } else if (_test_type == "linker") { 603 } else if (_test_type == "linker") {
572 test_runner_args += [ 604 test_runner_args += [
573 "--test-apk", 605 "--test-apk",
574 "@FileArg($_rebased_apk_build_config:deps_info:apk_path)", 606 "@FileArg($_rebased_apk_build_config:deps_info:apk_path)",
575 ] 607 ]
576 } else { 608 } else {
577 assert(false, "Invalid test type: $_test_type.") 609 assert(false, "Invalid test type: $_test_type.")
578 } 610 }
579 611
580 if (defined(invoker.additional_apks)) { 612 if (defined(invoker.additional_apks)) {
(...skipping 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2777 rebase_path(root_build_dir, root_build_dir), 2809 rebase_path(root_build_dir, root_build_dir),
2778 "--packed-libraries-dir", 2810 "--packed-libraries-dir",
2779 rebase_path(_packed_libraries_dir, root_build_dir), 2811 rebase_path(_packed_libraries_dir, root_build_dir),
2780 "--libraries=${invoker.libraries_filearg}", 2812 "--libraries=${invoker.libraries_filearg}",
2781 "--filelistjson", 2813 "--filelistjson",
2782 rebase_path(invoker.file_list_json, root_build_dir), 2814 rebase_path(invoker.file_list_json, root_build_dir),
2783 ] 2815 ]
2784 } 2816 }
2785 } 2817 }
2786 } 2818 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698