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

Unified Diff: build/android/test_runner.gypi

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 comments. 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
Index: build/android/test_runner.gypi
diff --git a/build/android/test_runner.gypi b/build/android/test_runner.gypi
new file mode 100644
index 0000000000000000000000000000000000000000..dec63239713484b42b54351e6349b993527e7d87
--- /dev/null
+++ b/build/android/test_runner.gypi
@@ -0,0 +1,71 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Generates a script in the output bin directory which runs the test
+# target using the test runner script in build/android/pylib/test_runner.py.
+#
+# To use this, include this file in a gtest or instrumentation test target.
+# {
+# 'target_name': 'gtest',
+# 'type': 'none',
+# 'variables': {
+# 'test_type': 'gtest', # string
+# 'test_suite_name': 'gtest_suite' # string
+# 'isolate_file': 'path/to/gtest.isolate' # string
+# },
+# 'includes': ['path/to/this/gypi/file'],
+# }
+#
+# {
+# 'target_name': 'instrumentation_apk',
+# 'type': 'none',
+# 'variables': {
+# 'test_type': 'instrumentation', # string
+# 'apk_name': 'TestApk' # string
+# 'isolate_file': 'path/to/instrumentation_test.isolate' # string
+# },
+# 'includes': ['path/to/this/gypi/file'],
+# }
+#
+
+{
+ 'variables': {
+ 'variables': {
+ 'isolate_file%': '',
+ },
+ 'test_runner_args': ['--output-directory', '<(PRODUCT_DIR)'],
+ 'conditions': [
+ ['test_type == "gtest"', {
+ 'test_runner_args': ['--suite', '<(test_suite_name)'],
+ 'script_name': 'run_<(test_suite_name)',
+ }],
+ ['test_type == "instrumentation"', {
+ 'test_runner_args': ['--test-apk', '<(apk_name)'],
+ 'script_name': 'run_<(apk_name)',
+ }],
+ ['isolate_file != ""', {
+ 'test_runner_args': ['--isolate-file-path', '<(isolate_file)']
+ }],
+ ],
+ },
+ 'actions': [
+ {
jbudorick 2015/05/18 18:20:23 nit: indent this block
mikecase (-- gone --) 2015/05/18 18:43:46 Done.
+ 'action_name': 'create_test_runner_script_<(script_name)',
+ 'message': 'Creating test runner script <(script_name)',
+ 'variables': {
+ 'script_output_path': '<(PRODUCT_DIR)/bin/<(script_name)',
+ },
+ 'inputs': [
+ '<(DEPTH)/build/android/gyp/create_test_runner_script.py',
+ ],
+ 'outputs': [
+ '<(script_output_path)'
+ ],
+ 'action': [
+ 'python', '<(DEPTH)/build/android/gyp/create_test_runner_script.py',
+ '--script-output-path=<(script_output_path)',
+ '<(test_type)', '<@(test_runner_args)',
+ ],
+ }],
+}

Powered by Google App Engine
This is Rietveld 408576698