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

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 comments from thestig and ddorwin. 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
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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 script = "//build/android/gyp/generate_split_manifest.py" 1244 script = "//build/android/gyp/generate_split_manifest.py"
1245 outputs = [ 1245 outputs = [
1246 depfile, 1246 depfile,
1247 invoker.out_manifest, 1247 invoker.out_manifest,
1248 ] 1248 ]
1249 inputs = [ 1249 inputs = [
1250 invoker.main_manifest, 1250 invoker.main_manifest,
1251 ] 1251 ]
1252 } 1252 }
1253 } 1253 }
1254
1255 # Generates a script in the output bin directory which runs the test
1256 # target using the test runner script in build/android/test_runner.py.
1257 template("test_runner_script") {
1258 testonly = true
1259 _test_name = invoker.test_name
1260 _test_type = invoker.test_type
1261
1262 action(target_name) {
1263 script = "//build/android/gyp/create_test_runner_script.py"
1264 depfile = "$target_gen_dir/$target_name.d"
1265
1266 test_runner_args = [
1267 _test_type,
1268 "--output-directory",
1269 rebase_path(root_build_dir, root_build_dir),
1270 ]
1271 if (_test_type == "gtest") {
1272 assert(defined(invoker.test_suite))
1273 test_runner_args += [
1274 "--suite",
1275 invoker.test_suite,
1276 ]
1277 } else if (_test_type == "instrumentation") {
1278 assert(defined(invoker.test_apk))
1279 test_runner_args += [
1280 "--test-apk",
1281 invoker.test_apk,
1282 ]
1283 } else {
1284 assert(false, "Invalid test type: $_test_type.")
1285 }
1286
1287 if (defined(invoker.isolate_file)) {
1288 test_runner_args += [
1289 "--isolate-file-path",
1290 rebase_path(invoker.isolate_file, root_build_dir),
1291 ]
1292 }
1293
1294 generated_script = "$root_build_dir/bin/run_${_test_name}"
1295 outputs = [
1296 depfile,
1297 generated_script,
1298 ]
1299 args = [
1300 "--depfile",
1301 rebase_path(depfile, root_build_dir),
1302 "--script-output-path",
1303 rebase_path(generated_script, root_build_dir),
1304 ]
1305 args += test_runner_args
1306 }
1307 }
OLDNEW
« no previous file with comments | « build/apk_test.gypi ('k') | build/config/android/rules.gni » ('j') | media/midi/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698