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

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

Issue 1703863003: Created separate shards for suspicious testcases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 4 years, 10 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 173628b46134d6c7fe4b5eab246fea610c8836a6..e4649e63c3b860ff635cd630b8c9babff7ba4350 100644
--- a/build/android/pylib/gtest/gtest_test_instance.py
+++ b/build/android/pylib/gtest/gtest_test_instance.py
@@ -343,6 +343,24 @@ class GtestTestInstance(test_instance.TestInstance):
return '*-%s' % ':'.join(disabled_filter_items)
+ def GetCrashedTestCase(self, output):
+ crash_happened = re.search(r'FAILURES!!! Tests run: \d+, Failures: \d+,' \
jbudorick 2016/02/27 00:31:37 all of the regexes in here should compiled into mo
+ ' Errors: 1', output[-1])
+ if not crash_happened:
+ return
+
+ #Crashes that will cause output like DCHECK(false).
jbudorick 2016/02/27 00:31:37 nit: # Crashes ...
+ has_crash = re.search(r'\[ERROR:.*?\] Currently running: ', output[-3])
jbudorick 2016/02/27 00:31:37 magical -3
+ if has_crash:
+ return output[-3][len(has_crash.group(0)):]
+
+ # Crashes that will cause output like null pointer dereference.
+ index = output.index('[ CRASHED ]')
+ if not index == -1:
+ run_info = re.search(r'(?<=\[ RUN \] ).*', output[index-1])
jbudorick 2016/02/27 00:31:37 Why is this doing a lookbehind if you're matching
+ if run_info:
+ return run_info.group(0)
+
# pylint: disable=no-self-use
def ParseGTestOutput(self, output):
"""Parses raw gtest output and returns a list of results.

Powered by Google App Engine
This is Rietveld 408576698