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

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

Issue 2842603002: (Reland x2) Expose resources in Robolectric/JUnit tests. (Closed)
Patch Set: Rebase Created 3 years, 7 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
« no previous file with comments | « build/android/test_runner.pydeps ('k') | build/config/android/rules.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 action(target_name) { 84 action(target_name) {
85 set_sources_assignment_filter([]) 85 set_sources_assignment_filter([])
86 build_config = invoker.build_config 86 build_config = invoker.build_config
87 87
88 assert(type == "android_apk" || type == "java_library" || 88 assert(type == "android_apk" || type == "java_library" ||
89 type == "android_resources" || type == "deps_dex" || 89 type == "android_resources" || type == "deps_dex" ||
90 type == "dist_jar" || type == "android_assets" || 90 type == "dist_jar" || type == "android_assets" ||
91 type == "resource_rewriter" || type == "java_binary" || 91 type == "resource_rewriter" || type == "java_binary" ||
92 type == "group" || type == "java_prebuilt") 92 type == "group" || type == "java_prebuilt" || type == "junit_binary")
93 93
94 forward_variables_from(invoker, 94 forward_variables_from(invoker,
95 [ 95 [
96 "deps", 96 "deps",
97 "testonly", 97 "testonly",
98 ]) 98 ])
99 if (!defined(deps)) { 99 if (!defined(deps)) {
100 deps = [] 100 deps = []
101 } 101 }
102 102
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 if (emma_coverage) { 560 if (emma_coverage) {
561 # Set a default coverage output directory (can be overridden by user 561 # Set a default coverage output directory (can be overridden by user
562 # passing the same flag). 562 # passing the same flag).
563 test_runner_args += [ 563 test_runner_args += [
564 "--coverage-dir", 564 "--coverage-dir",
565 rebase_path("$root_out_dir/coverage", root_build_dir), 565 rebase_path("$root_out_dir/coverage", root_build_dir),
566 ] 566 ]
567 } 567 }
568 } else if (_test_type == "junit") { 568 } else if (_test_type == "junit") {
569 assert(defined(invoker.test_suite)) 569 assert(defined(invoker.test_suite))
570 _device_test = false
570 test_runner_args += [ 571 test_runner_args += [
571 "--test-suite", 572 "--test-suite",
572 invoker.test_suite, 573 invoker.test_suite,
573 ] 574 ]
574 _device_test = false 575 if (defined(invoker.android_manifest_path)) {
576 test_runner_args += [
577 "--android-manifest-path",
578 rebase_path(invoker.android_manifest_path, root_build_dir),
579 ]
580 }
581
582 if (defined(invoker.package_name)) {
583 test_runner_args += [
584 "--package-name",
585 invoker.package_name,
586 ]
587
588 deps += [ ":${invoker.test_suite}__build_config" ]
589 _junit_binary_build_config =
590 "${target_gen_dir}/${invoker.test_suite}.build_config"
591 _rebased_build_config =
592 rebase_path("$_junit_binary_build_config", root_build_dir)
593 test_runner_args += [
594 "--resource-zips",
595 "@FileArg($_rebased_build_config:resources:dependency_zips)",
596 ]
597 }
598
599 test_runner_args += [
600 "--robolectric-runtime-deps-dir",
601 rebase_path("$root_build_dir/lib.java/third_party/robolectric",
602 root_build_dir),
603 ]
575 } else if (_test_type == "linker") { 604 } else if (_test_type == "linker") {
576 test_runner_args += [ 605 test_runner_args += [
577 "--test-apk", 606 "--test-apk",
578 "@FileArg($_rebased_apk_build_config:deps_info:apk_path)", 607 "@FileArg($_rebased_apk_build_config:deps_info:apk_path)",
579 ] 608 ]
580 } else { 609 } else {
581 assert(false, "Invalid test type: $_test_type.") 610 assert(false, "Invalid test type: $_test_type.")
582 } 611 }
583 612
584 if (defined(invoker.additional_apks)) { 613 if (defined(invoker.additional_apks)) {
(...skipping 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after
2847 rebase_path(root_build_dir, root_build_dir), 2876 rebase_path(root_build_dir, root_build_dir),
2848 "--packed-libraries-dir", 2877 "--packed-libraries-dir",
2849 rebase_path(_packed_libraries_dir, root_build_dir), 2878 rebase_path(_packed_libraries_dir, root_build_dir),
2850 "--libraries=${invoker.libraries_filearg}", 2879 "--libraries=${invoker.libraries_filearg}",
2851 "--filelistjson", 2880 "--filelistjson",
2852 rebase_path(invoker.file_list_json, root_build_dir), 2881 rebase_path(invoker.file_list_json, root_build_dir),
2853 ] 2882 ]
2854 } 2883 }
2855 } 2884 }
2856 } 2885 }
OLDNEW
« no previous file with comments | « build/android/test_runner.pydeps ('k') | build/config/android/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698