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 | 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 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 script = "//build/android/gyp/generate_split_manifest.py" | 1370 script = "//build/android/gyp/generate_split_manifest.py" |
1371 outputs = [ | 1371 outputs = [ |
1372 depfile, | 1372 depfile, |
1373 invoker.out_manifest, | 1373 invoker.out_manifest, |
1374 ] | 1374 ] |
1375 inputs = [ | 1375 inputs = [ |
1376 invoker.main_manifest, | 1376 invoker.main_manifest, |
1377 ] | 1377 ] |
1378 } | 1378 } |
1379 } | 1379 } |
| 1380 |
| 1381 # Generates a script in the output bin directory which runs the test |
| 1382 # target using the test runner script in build/android/test_runner.py. |
| 1383 template("test_runner_script") { |
| 1384 testonly = true |
| 1385 _test_name = invoker.test_name |
| 1386 _test_type = invoker.test_type |
| 1387 |
| 1388 action(target_name) { |
| 1389 script = "//build/android/gyp/create_test_runner_script.py" |
| 1390 depfile = "$target_gen_dir/$target_name.d" |
| 1391 |
| 1392 test_runner_args = [ |
| 1393 _test_type, |
| 1394 "--output-directory", |
| 1395 rebase_path(root_build_dir, root_build_dir), |
| 1396 ] |
| 1397 if (_test_type == "gtest") { |
| 1398 assert(defined(invoker.test_suite)) |
| 1399 test_runner_args += [ |
| 1400 "--suite", |
| 1401 invoker.test_suite, |
| 1402 ] |
| 1403 } else if (_test_type == "instrumentation") { |
| 1404 assert(defined(invoker.test_apk)) |
| 1405 test_runner_args += [ |
| 1406 "--test-apk", |
| 1407 invoker.test_apk, |
| 1408 ] |
| 1409 } else { |
| 1410 assert(false, "Invalid test type: $_test_type.") |
| 1411 } |
| 1412 |
| 1413 if (defined(invoker.isolate_file)) { |
| 1414 test_runner_args += [ |
| 1415 "--isolate-file-path", |
| 1416 rebase_path(invoker.isolate_file, root_build_dir), |
| 1417 ] |
| 1418 } |
| 1419 |
| 1420 generated_script = "$root_build_dir/bin/run_${_test_name}" |
| 1421 outputs = [ |
| 1422 depfile, |
| 1423 generated_script, |
| 1424 ] |
| 1425 args = [ |
| 1426 "--depfile", |
| 1427 rebase_path(depfile, root_build_dir), |
| 1428 "--script-output-path", |
| 1429 rebase_path(generated_script, root_build_dir), |
| 1430 ] |
| 1431 args += test_runner_args |
| 1432 } |
| 1433 } |
OLD | NEW |