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

Side by Side Diff: scripts/common/gtest_utils.py

Issue 10556042: Update GTest Parsing Code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | scripts/common/unittests/gtest_utils_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import re 6 import re
7 7
8 8
9 class GTestLogParser(object): 9 class GTestLogParser(object):
10 """This helper class process GTest test output.""" 10 """This helper class process GTest test output."""
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 def FailedTests(self, include_fails=False, include_flaky=False): 109 def FailedTests(self, include_fails=False, include_flaky=False):
110 """Returns list of tests that failed, timed out, or didn't finish 110 """Returns list of tests that failed, timed out, or didn't finish
111 (crashed). 111 (crashed).
112 112
113 This list will be incorrect until the complete log has been processed, 113 This list will be incorrect until the complete log has been processed,
114 because it will show currently running tests as having failed. 114 because it will show currently running tests as having failed.
115 115
116 Args: 116 Args:
117 include_fails: If true, all failing tests with FAILS_ in their names will 117 include_fails: If true, all failing tests with FAILS_ in their names will
118 be included. Otherwise, they will only be included if they crashed. 118 be included. Otherwise, they will only be included if they crashed or
119 timed out.
119 include_flaky: If true, all failing tests with FLAKY_ in their names will 120 include_flaky: If true, all failing tests with FLAKY_ in their names will
120 be included. Otherwise, they will only be included if they crashed. 121 be included. Otherwise, they will only be included if they crashed or
122 timed out.
121 123
122 """ 124 """
123 return (self._TestsByStatus('failed', include_fails, include_flaky) + 125 return (self._TestsByStatus('failed', include_fails, include_flaky) +
124 self._TestsByStatus('timeout', include_fails, include_flaky) + 126 self._TestsByStatus('timeout', True, True) +
125 self._TestsByStatus('warning', include_fails, include_flaky) + 127 self._TestsByStatus('warning', include_fails, include_flaky) +
126 self.RunningTests()) 128 self.RunningTests())
127 129
128 def DisabledTests(self): 130 def DisabledTests(self):
129 """Returns the name of the disabled test (if there is only 1) or the number 131 """Returns the name of the disabled test (if there is only 1) or the number
130 of disabled tests. 132 of disabled tests.
131 """ 133 """
132 return self._disabled_tests 134 return self._disabled_tests
133 135
134 def FlakyTests(self): 136 def FlakyTests(self):
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 if results: 303 if results:
302 test_name = results.group(1) 304 test_name = results.group(1)
303 status = self._StatusOfTest(test_name) 305 status = self._StatusOfTest(test_name)
304 if status in ('not known', 'OK'): 306 if status in ('not known', 'OK'):
305 self._test_status[test_name] = ( 307 self._test_status[test_name] = (
306 'failed', ['Unknown error, see stdio log.']) 308 'failed', ['Unknown error, see stdio log.'])
307 else: 309 else:
308 self._parsing_failures = False 310 self._parsing_failures = False
309 elif line.startswith('Failing tests:'): 311 elif line.startswith('Failing tests:'):
310 self._parsing_failures = True 312 self._parsing_failures = True
OLDNEW
« no previous file with comments | « no previous file | scripts/common/unittests/gtest_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698