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

Unified Diff: testing/test.gni

Issue 1805643002: 🚀 Geneate base_unittest's Android .isolate file at build-time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: os.nice() and use isolate_file rather than requires_apk_isolate Created 4 years, 9 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/android/gyp/gen-android-test-isolate.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/test.gni
diff --git a/testing/test.gni b/testing/test.gni
index 4503860eedcb07b4c186e92ae239045e33ab41bb..897926b605d7c6b52e8db0463c3a012b9f9e0ee8 100644
--- a/testing/test.gni
+++ b/testing/test.gni
@@ -6,6 +6,23 @@
# TEST SETUP
# ==============================================================================
+if (is_android) {
+ template("_gen_apk_isolate") {
+ action(target_name) {
+ script = "//build/android/gyp/gen-android-test-isolate.py"
+ outputs = [
+ invoker.output,
+ ]
+ args = [
+ "--out-file",
+ rebase_path(invoker.output, root_build_dir),
+ ".",
+ invoker.lib_target,
+ ]
+ }
+ }
+}
+
# Define a test as an executable (or apk on Android) with the "testonly" flag
# set.
template("test") {
@@ -17,6 +34,19 @@ template("test") {
library_name = "_${target_name}__library"
apk_name = "${target_name}_apk"
+ # TODO(agrieve): Delete invoker.isolate_file when write_runtime_deps() is
+ # available. http://crbug.com/593416
+ _requires_apk_isolate =
+ defined(invoker.isolate_file) && invoker.isolate_file != ""
+
+ if (_requires_apk_isolate) {
+ _apk_isolate_target_name = "_${target_name}__apk_isolate"
+ _apk_isolate_path = "$target_gen_dir/$target_name.apk.isolate"
+ _gen_apk_isolate(_apk_isolate_target_name) {
+ lib_target = get_label_info(":$library_name", "label_no_toolchain")
+ output = _apk_isolate_path
+ }
+ }
shared_library(library_name) {
# Configs will always be defined since we set_defaults for a component
# in the main config. We want to use those rather than whatever came with
@@ -89,8 +119,8 @@ template("test") {
test_name = _test_name
test_type = "gtest"
test_suite = _test_name
- if (defined(invoker.isolate_file)) {
- isolate_file = invoker.isolate_file
+ if (_requires_apk_isolate) {
+ isolate_file = _apk_isolate_path
}
}
incremental_test_runner_script_name =
@@ -101,25 +131,31 @@ template("test") {
test_type = "gtest"
test_suite = _test_name
incremental_install = true
- if (defined(invoker.isolate_file)) {
- isolate_file = invoker.isolate_file
+ if (_requires_apk_isolate) {
+ isolate_file = _apk_isolate_path
}
}
group(target_name) {
testonly = true
- datadeps = [
+ data_deps = [
":$test_runner_script_name",
]
+ if (_requires_apk_isolate) {
+ data_deps += [ ":$_apk_isolate_target_name" ]
+ }
deps = [
":$apk_name",
]
}
group("${target_name}_incremental") {
testonly = true
- datadeps = [
+ data_deps = [
":$incremental_test_runner_script_name",
]
+ if (_requires_apk_isolate) {
+ data_deps += [ ":$_apk_isolate_target_name" ]
+ }
deps = [
":${apk_name}_incremental",
]
« no previous file with comments | « build/android/gyp/gen-android-test-isolate.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698