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

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

Issue 2752493002: [android] Add support for passing command-line flags directly. (Closed)
Patch Set: Ensure command_line_flags is always present in the Namespace. 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
« no previous file with comments | « no previous file | build/android/pylib/instrumentation/instrumentation_test_instance.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a4264282161fd43742a01adf4535a5b6101d131b..df285fbe5b62f89a5493268b0785840b95903c2c 100644
--- a/build/android/pylib/gtest/gtest_test_instance.py
+++ b/build/android/pylib/gtest/gtest_test_instance.py
@@ -334,11 +334,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:
+ self._flags.append('--gtest_also_run_disabled_tests')
+ if args.test_arguments:
+ self._flags.extend(args.test_arguments.split())
+
@property
def activity(self):
return self._apk_helper and self._apk_helper.GetActivityName()
@@ -380,8 +394,8 @@ class GtestTestInstance(test_instance.TestInstance):
return self._extras
@property
- def gtest_also_run_disabled_tests(self):
- return self._run_disabled
+ def flags(self):
+ return self._flags
@property
def gtest_filter(self):
@@ -416,10 +430,6 @@ class GtestTestInstance(test_instance.TestInstance):
return self._test_apk_incremental_install_script
@property
- def test_arguments(self):
- return self._test_arguments
-
- @property
def total_external_shards(self):
return self._total_external_shards
« no previous file with comments | « no previous file | build/android/pylib/instrumentation/instrumentation_test_instance.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698