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

Unified 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: Renamed datadeps to data_deps to reflect recent change. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/apk_test.gypi ('k') | build/config/android/rules.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/internal_rules.gni
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index af2db4423d4974f1be8489a58d932377f071c75f..8370cc45081c8a47fbef005bf77c8500ea378d92 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -1377,3 +1377,57 @@ template("generate_split_manifest") {
]
}
}
+
+# Generates a script in the output bin directory which runs the test
+# target using the test runner script in build/android/test_runner.py.
+template("test_runner_script") {
+ testonly = true
+ _test_name = invoker.test_name
+ _test_type = invoker.test_type
+
+ action(target_name) {
+ script = "//build/android/gyp/create_test_runner_script.py"
+ depfile = "$target_gen_dir/$target_name.d"
+
+ test_runner_args = [
+ _test_type,
+ "--output-directory",
+ rebase_path(root_build_dir, root_build_dir),
+ ]
+ if (_test_type == "gtest") {
+ assert(defined(invoker.test_suite))
+ test_runner_args += [
+ "--suite",
+ invoker.test_suite,
+ ]
+ } else if (_test_type == "instrumentation") {
+ assert(defined(invoker.test_apk))
+ test_runner_args += [
+ "--test-apk",
+ invoker.test_apk,
+ ]
+ } else {
+ assert(false, "Invalid test type: $_test_type.")
+ }
+
+ if (defined(invoker.isolate_file)) {
+ test_runner_args += [
+ "--isolate-file-path",
+ rebase_path(invoker.isolate_file, root_build_dir),
+ ]
+ }
+
+ generated_script = "$root_build_dir/bin/run_${_test_name}"
+ outputs = [
+ depfile,
+ generated_script,
+ ]
+ args = [
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--script-output-path",
+ rebase_path(generated_script, root_build_dir),
+ ]
+ args += test_runner_args
+ }
+}
« 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