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

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

Issue 1120883002: [Android] Generate scripts at build time to run android tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed jbudorick's nits. Created 5 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/apk_test.gypi ('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 import("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 6
7 assert(is_android) 7 assert(is_android)
8 8
9 rebased_android_sdk = rebase_path(android_sdk, root_build_dir) 9 rebased_android_sdk = rebase_path(android_sdk, root_build_dir)
10 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir) 10 rebased_android_sdk_root = rebase_path(android_sdk_root, root_build_dir)
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 script = "//build/android/gyp/generate_split_manifest.py" 1248 script = "//build/android/gyp/generate_split_manifest.py"
1249 outputs = [ 1249 outputs = [
1250 depfile, 1250 depfile,
1251 invoker.out_manifest, 1251 invoker.out_manifest,
1252 ] 1252 ]
1253 inputs = [ 1253 inputs = [
1254 invoker.main_manifest, 1254 invoker.main_manifest,
1255 ] 1255 ]
1256 } 1256 }
1257 } 1257 }
1258
1259 # Generates a script in the output bin directory which runs the test
1260 # target using the test runner script in build/android/test_runner.py.
1261 template("test_runner_script") {
1262 testonly = true
1263 _test_type = invoker.test_type
1264
1265 action(target_name) {
1266 script = "//build/android/gyp/create_test_runner_script.py"
1267 depfile = "$target_gen_dir/$target_name.d"
1268
1269 test_runner_args = [
1270 _test_type,
1271 "--output-directory",
1272 rebase_path(root_build_dir, root_build_dir),
1273 ]
1274 if (_test_type == "gtest") {
1275 assert(defined(invoker.test_suite))
1276 test_name = invoker.test_suite
1277 test_runner_args += [
1278 "--suite",
1279 invoker.test_suite,
1280 ]
1281 } else if (_test_type == "instrumentation") {
1282 assert(defined(invoker.test_apk))
1283 test_name = invoker.test_apk
cjhopman 2015/05/20 03:09:27 I feel like this should be based on the target nam
mikecase (-- gone --) 2015/05/20 21:22:03 Done.
1284 test_runner_args += [
1285 "--test-apk",
1286 invoker.test_apk,
1287 ]
1288 } else {
1289 assert(false, "Invalid test type: $_test_type.")
1290 }
1291
1292 if (defined(invoker.isolate_file)) {
1293 test_runner_args += [
1294 "--isolate-file-path",
1295 rebase_path(invoker.isolate_file, root_build_dir),
1296 ]
1297 }
1298
1299 generated_script = "$root_build_dir/bin/run_${test_name}"
1300 outputs = [
1301 depfile,
1302 generated_script,
1303 ]
1304 args = [
1305 "--depfile",
1306 rebase_path(depfile, root_build_dir),
1307 "--script-output-path",
1308 rebase_path(generated_script, root_build_dir),
1309 ]
1310 args += test_runner_args
1311 }
1312 }
OLDNEW
« no previous file with comments | « build/apk_test.gypi ('k') | build/config/android/rules.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698