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/config/android/config.gni") | 7 import("//build/config/android/config.gni") |
8 import("//build/config/android/internal_rules.gni") | 8 import("//build/config/android/internal_rules.gni") |
9 import("//build/config/compiler/compiler.gni") | 9 import("//build/config/compiler/compiler.gni") |
10 import("//build/config/dcheck_always_on.gni") | 10 import("//build/config/dcheck_always_on.gni") |
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1077 # java_files = [ "org/chromium/foo/FooTest.java" ] | 1077 # java_files = [ "org/chromium/foo/FooTest.java" ] |
1078 # deps = [ ":bar_java" ] | 1078 # deps = [ ":bar_java" ] |
1079 # } | 1079 # } |
1080 template("junit_binary") { | 1080 template("junit_binary") { |
1081 set_sources_assignment_filter([]) | 1081 set_sources_assignment_filter([]) |
1082 testonly = true | 1082 testonly = true |
1083 | 1083 |
1084 _java_binary_target_name = "${target_name}__java_binary" | 1084 _java_binary_target_name = "${target_name}__java_binary" |
1085 _test_runner_target_name = "${target_name}__test_runner_script" | 1085 _test_runner_target_name = "${target_name}__test_runner_script" |
1086 | 1086 |
| 1087 _build_config = "$target_gen_dir/$target_name.build_config" |
| 1088 _build_config_target_name = "${target_name}__build_config" |
| 1089 write_build_config(_build_config_target_name) { |
| 1090 type = "junit_binary" |
| 1091 build_config = _build_config |
| 1092 if (defined(invoker.deps)) { |
| 1093 possible_config_deps = invoker.deps |
| 1094 } |
| 1095 } |
| 1096 |
1087 test_runner_script(_test_runner_target_name) { | 1097 test_runner_script(_test_runner_target_name) { |
1088 test_name = invoker.target_name | 1098 test_name = invoker.target_name |
1089 test_suite = invoker.target_name | 1099 test_suite = invoker.target_name |
1090 test_type = "junit" | 1100 test_type = "junit" |
1091 ignore_all_data_deps = true | 1101 ignore_all_data_deps = true |
| 1102 forward_variables_from(invoker, |
| 1103 [ |
| 1104 "android_manifest_path", |
| 1105 "package_name", |
| 1106 ]) |
1092 } | 1107 } |
1093 | 1108 |
1094 java_binary(_java_binary_target_name) { | 1109 java_binary(_java_binary_target_name) { |
1095 deps = [] | 1110 deps = [] |
1096 output_name = invoker.target_name | 1111 output_name = invoker.target_name |
1097 forward_variables_from(invoker, "*") | 1112 forward_variables_from(invoker, "*") |
1098 testonly = true | 1113 testonly = true |
1099 bypass_platform_checks = true | 1114 bypass_platform_checks = true |
1100 main_class = "org.chromium.testing.local.JunitTestMain" | 1115 main_class = "org.chromium.testing.local.JunitTestMain" |
1101 wrapper_script_name = "helper/$target_name" | 1116 wrapper_script_name = "helper/$target_name" |
1102 deps += [ | 1117 deps += [ |
1103 "//testing/android/junit:junit_test_support", | 1118 "//testing/android/junit:junit_test_support", |
1104 "//third_party/junit", | 1119 "//third_party/junit", |
1105 "//third_party/mockito:mockito_java", | 1120 "//third_party/mockito:mockito_java", |
1106 "//third_party/robolectric:robolectric_all_java", | 1121 "//third_party/robolectric:robolectric_all_java", |
1107 ] | 1122 ] |
1108 } | 1123 } |
1109 group(target_name) { | 1124 group(target_name) { |
1110 public_deps = [ | 1125 public_deps = [ |
| 1126 ":$_build_config_target_name", |
1111 ":$_java_binary_target_name", | 1127 ":$_java_binary_target_name", |
1112 ":$_test_runner_target_name", | 1128 ":$_test_runner_target_name", |
1113 ] | 1129 ] |
1114 } | 1130 } |
1115 } | 1131 } |
1116 | 1132 |
1117 # Declare a java library target | 1133 # Declare a java library target |
1118 # | 1134 # |
1119 # Variables | 1135 # Variables |
1120 # deps: Specifies the dependencies of this target. Java targets in this list | 1136 # deps: Specifies the dependencies of this target. Java targets in this list |
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2937 # because in practice they seem to contain classes required to be in the | 2953 # because in practice they seem to contain classes required to be in the |
2938 # classpath. | 2954 # classpath. |
2939 deps += _subjar_targets | 2955 deps += _subjar_targets |
2940 } | 2956 } |
2941 if (defined(_res_target_name)) { | 2957 if (defined(_res_target_name)) { |
2942 deps += [ ":$_res_target_name" ] | 2958 deps += [ ":$_res_target_name" ] |
2943 } | 2959 } |
2944 } | 2960 } |
2945 } | 2961 } |
2946 } | 2962 } |
OLD | NEW |