| 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 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
| 6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
| 7 import("//build/config/zip.gni") | 7 import("//build/config/zip.gni") |
| 8 import("//third_party/ijar/ijar.gni") | 8 import("//third_party/ijar/ijar.gni") |
| 9 | 9 |
| 10 assert(is_android) | 10 assert(is_android) |
| (...skipping 2055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2066 | 2066 |
| 2067 action(target_name) { | 2067 action(target_name) { |
| 2068 script = "//build/android/gyp/create_test_runner_script.py" | 2068 script = "//build/android/gyp/create_test_runner_script.py" |
| 2069 depfile = "$target_gen_dir/$target_name.d" | 2069 depfile = "$target_gen_dir/$target_name.d" |
| 2070 deps = [] | 2070 deps = [] |
| 2071 | 2071 |
| 2072 datadeps = [ | 2072 datadeps = [ |
| 2073 "//build/android:test_runner_py", | 2073 "//build/android:test_runner_py", |
| 2074 ] | 2074 ] |
| 2075 | 2075 |
| 2076 # apk_target is not used for native executable tests |
| 2077 # (e.g. breakpad_unittests). |
| 2078 if (defined(invoker.apk_target)) { |
| 2079 deps += [ "${invoker.apk_target}__build_config" ] |
| 2080 _apk_build_config = |
| 2081 get_label_info(invoker.apk_target, "target_gen_dir") + "/" + |
| 2082 get_label_info(invoker.apk_target, "name") + ".build_config" |
| 2083 _rebased_apk_build_config = rebase_path(_apk_build_config, root_build_dir) |
| 2084 assert(_rebased_apk_build_config != "") # Mark as used. |
| 2085 } |
| 2086 |
| 2076 test_runner_args = [ | 2087 test_runner_args = [ |
| 2077 _test_type, | 2088 _test_type, |
| 2078 "--output-directory", | 2089 "--output-directory", |
| 2079 rebase_path(root_build_dir, root_build_dir), | 2090 rebase_path(root_build_dir, root_build_dir), |
| 2080 ] | 2091 ] |
| 2081 | |
| 2082 # apk_target is not used for native executable tests | |
| 2083 # (e.g. breakpad_unittests). | |
| 2084 if (defined(invoker.apk_target)) { | |
| 2085 assert(!defined(invoker.executable)) | |
| 2086 deps += [ "${invoker.apk_target}__build_config" ] | |
| 2087 _apk_build_config = | |
| 2088 get_label_info(invoker.apk_target, "target_gen_dir") + "/" + | |
| 2089 get_label_info(invoker.apk_target, "name") + ".build_config" | |
| 2090 _rebased_apk_build_config = rebase_path(_apk_build_config, root_build_dir) | |
| 2091 assert(_rebased_apk_build_config != "") # Mark as used. | |
| 2092 } else if (_test_type == "gtest") { | |
| 2093 assert( | |
| 2094 defined(invoker.executable), | |
| 2095 "Must define either apk_target or executable for test_runner_script()"
) | |
| 2096 test_runner_args += [ | |
| 2097 "--executable-path", | |
| 2098 rebase_path(invoker.executable, root_build_dir), | |
| 2099 ] | |
| 2100 } | |
| 2101 | |
| 2102 if (_test_type == "gtest") { | 2092 if (_test_type == "gtest") { |
| 2103 assert(defined(invoker.test_suite)) | 2093 assert(defined(invoker.test_suite)) |
| 2104 test_runner_args += [ | 2094 test_runner_args += [ |
| 2105 "--suite", | 2095 "--suite", |
| 2106 invoker.test_suite, | 2096 invoker.test_suite, |
| 2107 ] | 2097 ] |
| 2108 } else if (_test_type == "instrumentation") { | 2098 } else if (_test_type == "instrumentation") { |
| 2109 _test_apk = "@FileArg($_rebased_apk_build_config:deps_info:apk_path)" | 2099 _test_apk = "@FileArg($_rebased_apk_build_config:deps_info:apk_path)" |
| 2110 if (_incremental_install) { | 2100 if (_incremental_install) { |
| 2111 _test_apk = "@FileArg($_rebased_apk_build_config:deps_info:incremental_a
pk_path)" | 2101 _test_apk = "@FileArg($_rebased_apk_build_config:deps_info:incremental_a
pk_path)" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2185 ] | 2175 ] |
| 2186 args = [ | 2176 args = [ |
| 2187 "--depfile", | 2177 "--depfile", |
| 2188 rebase_path(depfile, root_build_dir), | 2178 rebase_path(depfile, root_build_dir), |
| 2189 "--script-output-path", | 2179 "--script-output-path", |
| 2190 rebase_path(generated_script, root_build_dir), | 2180 rebase_path(generated_script, root_build_dir), |
| 2191 ] | 2181 ] |
| 2192 args += test_runner_args | 2182 args += test_runner_args |
| 2193 } | 2183 } |
| 2194 } | 2184 } |
| OLD | NEW |