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

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

Issue 788753002: [Android] Implement gtest and local in platform mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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 1e8769310e7d797dc0d872e01a1b0972d31e9551..ae08adf5a06d393945de7c892035d66abe734dc6 100644
--- a/build/android/pylib/gtest/gtest_test_instance.py
+++ b/build/android/pylib/gtest/gtest_test_instance.py
@@ -38,24 +38,60 @@ _DEPS_EXCLUSION_LIST = [
]
+# TODO(jbudorick): Make this a classmethod of GtestTestInstance once
klundberg 2014/12/09 02:30:47 s/classmethod/class method
jbudorick 2014/12/09 15:46:51 Done.
+# test_package_apk and test_package_exe are gone.
+def ParseGTestListTests(raw_list):
+ """Parses a raw test list as provided by --gtest_list_tests.
+
+ Args:
+ raw_list: The raw test listing with the following format:
+
+ IPCChannelTest.
+ SendMessageInChannelConnected
+ IPCSyncChannelTest.
+ Simple
+ DISABLED_SendWithTimeoutMixedOKAndTimeout
+
+ Returns:
+ A list of all tests. For the above raw listing:
+
+ [IPCChannelTest.SendMessageInChannelConnected, IPCSyncChannelTest.Simple,
+ IPCSyncChannelTest.DISABLED_SendWithTimeoutMixedOKAndTimeout]
+ """
+ ret = []
+ current = ''
+ for test in raw_list:
+ if not test:
+ continue
+ if test[0] != ' ':
+ test_case = test.split()[0]
+ if test_case.endswith('.'):
+ current = test_case
+ elif not 'YOU HAVE' in test:
+ test_name = test.split()[0]
+ ret += [current + test_name]
+ return ret
+
+
class GtestTestInstance(test_instance.TestInstance):
- def __init__(self, options, isolate_delegate):
+ def __init__(self, args, isolate_delegate):
super(GtestTestInstance, self).__init__()
+ # TODO(jbudorick): accept theirs during merge conflicts
klundberg 2014/12/09 02:30:47 I'm assuming this is just a note for yourself unti
jbudorick 2014/12/09 15:46:51 Yes, it is. I will probably hold this CL until Ran
self._apk_path = os.path.join(
- constants.GetOutDirectory(), '%s_apk' % options.suite_name,
- '%s-debug.apk' % options.suite_name)
+ constants.GetOutDirectory(), '%s_apk' % args.suite_name[0],
+ '%s-debug.apk' % args.suite_name[0])
self._data_deps = []
- self._gtest_filter = options.test_filter
- if options.isolate_file_path:
- self._isolate_abs_path = os.path.abspath(options.isolate_file_path)
+ self._gtest_filter = args.test_filter
+ if args.isolate_file_path:
+ self._isolate_abs_path = os.path.abspath(args.isolate_file_path)
self._isolate_delegate = isolate_delegate
self._isolated_abs_path = os.path.join(
- constants.GetOutDirectory(), '%s.isolated' % options.suite_name)
+ constants.GetOutDirectory(), '%s.isolated' % args.suite_name)
else:
logging.warning('No isolate file provided. No data deps will be pushed.');
self._isolate_delegate = None
- self._suite = options.suite_name
+ self._suite = args.suite_name
#override
def TestType(self):

Powered by Google App Engine
This is Rietveld 408576698