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

Unified Diff: scripts/master/log_parser/gtest_command.py

Issue 9134001: Add parsing of "Failing tests:" from gtest output. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build/
Patch Set: '' Created 8 years, 11 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 | scripts/master/unittests/gtest_command_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/master/log_parser/gtest_command.py
===================================================================
--- scripts/master/log_parser/gtest_command.py (revision 116679)
+++ scripts/master/log_parser/gtest_command.py (working copy)
@@ -25,6 +25,7 @@
self._failure_description = []
self._current_suppression_hash = ''
self._current_suppression = []
+ self._parsing_failures = False
# Line number currently being processed.
self._line_number = 0
@@ -53,6 +54,7 @@
# This regexp also matches SomeName.SomeTest/1, which should be harmless.
test_name_regexp = r'((\w+/)?\w+\.\w+(/\d+)?)'
+ self._test_name = re.compile(test_name_regexp)
self._test_start = re.compile('\[\s+RUN\s+\] ' + test_name_regexp)
self._test_ok = re.compile('\[\s+OK\s+\] ' + test_name_regexp)
self._test_fail = re.compile('\[\s+FAILED\s+\] ' + test_name_regexp)
@@ -289,6 +291,21 @@
if self._current_test:
self._failure_description.append(line)
+ # Parse the "Failing tests:" list at the end of the output, and add any
+ # additional failed tests to the list. For example, this includes tests
+ # that crash after the OK line.
+ if self._parsing_failures:
+ results = self._test_name.search(line)
+ if results:
+ test_name = results.group(1)
+ status = self._StatusOfTest(test_name)
+ if status in ('not known', 'OK'):
+ self._test_status[test_name] = (
+ 'failed', ['Unknown error, see stdio log.'])
+ else:
+ self._parsing_failures = False
+ elif line.startswith('Failing tests:'):
+ self._parsing_failures = True
class GTestCommand(shell.ShellCommand):
"""Buildbot command that knows how to display GTest output."""
« no previous file with comments | « no previous file | scripts/master/unittests/gtest_command_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698