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

Unified Diff: build/android/pylib/gtest/gtest_test_instance.py

Issue 2752493002: [android] Add support for passing command-line flags directly. (Closed)
Patch Set: Created 3 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
Index: build/android/pylib/gtest/gtest_test_instance.py
diff --git a/build/android/pylib/gtest/gtest_test_instance.py b/build/android/pylib/gtest/gtest_test_instance.py
index 678f68b17ea9b5c48d94455d8aba16293a762ce4..e1d486e1e87330ed558d968d411a93a2ca57451b 100644
--- a/build/android/pylib/gtest/gtest_test_instance.py
+++ b/build/android/pylib/gtest/gtest_test_instance.py
@@ -332,11 +332,25 @@ class GtestTestInstance(test_instance.TestInstance):
self._app_data_files = None
self._app_data_file_dir = None
- self._test_arguments = args.test_arguments
+ self._flags = None
+ self._initializeCommandLineFlags(args)
# TODO(jbudorick): Remove this once it's deployed.
self._enable_xml_result_parsing = args.enable_xml_result_parsing
+ def _initializeCommandLineFlags(self, args):
+ self._flags = []
+ if args.command_line_flags:
+ self._flags.extend(args.command_line_flags)
+ if args.device_flags_file:
+ with open(args.device_flags_file) as f:
+ stripped_lines = (l.strip() for l in f)
+ self._flags.extend(flag for flag in stripped_lines if flag)
+ if args.run_disabled:
shenghuazhang 2017/03/14 05:45:05 If we need to append args.run_disabled in _flags,
jbudorick 2017/03/15 18:27:59 The disable mechanism works a bit differently for
+ self._flags.append('--gtest_also_run_disabled_tests')
mikecase (-- gone --) 2017/03/13 23:59:47 nit: wrong indentation
jbudorick 2017/03/15 18:27:59 oops
+ if args.test_arguments:
+ self._flags.extend(args.test_arguments.split())
+
@property
def activity(self):
return self._apk_helper and self._apk_helper.GetActivityName()
@@ -370,6 +384,10 @@ class GtestTestInstance(test_instance.TestInstance):
return self._extras
@property
+ def flags(self):
+ return self._flags
+
+ @property
def gtest_also_run_disabled_tests(self):
mikecase (-- gone --) 2017/03/13 23:59:47 Probably remove this since it is no longer used an
jbudorick 2017/03/15 18:27:59 Done.
return self._run_disabled
@@ -406,10 +424,6 @@ class GtestTestInstance(test_instance.TestInstance):
return self._test_apk_incremental_install_script
@property
- def test_arguments(self):
- return self._test_arguments
-
- @property
def extract_test_list_from_filter(self):
return self._extract_test_list_from_filter
« no previous file with comments | « no previous file | build/android/pylib/instrumentation/instrumentation_test_instance.py » ('j') | build/android/test_runner.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698