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

Side by Side Diff: build/android/pylib/base/base_test_result.py

Issue 2541093004: [Android] Try harder to run every gtest within each try. (Closed)
Patch Set: mikecase comment Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | build/android/pylib/local/device/local_device_gtest_run.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 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Module containing base test results classes.""" 5 """Module containing base test results classes."""
6 6
7 import threading 7 import threading
8 8
9 9
10 class ResultType(object): 10 class ResultType(object):
11 """Class enumerating test types.""" 11 """Class enumerating test types."""
12 # The test passed.
12 PASS = 'PASS' 13 PASS = 'PASS'
14
15 # The test was intentionally skipped.
13 SKIP = 'SKIP' 16 SKIP = 'SKIP'
17
18 # The test failed.
14 FAIL = 'FAIL' 19 FAIL = 'FAIL'
20
21 # The test caused the containing process to crash.
15 CRASH = 'CRASH' 22 CRASH = 'CRASH'
23
24 # The test timed out.
16 TIMEOUT = 'TIMEOUT' 25 TIMEOUT = 'TIMEOUT'
26
27 # The test ran, but we couldn't determine what happened.
17 UNKNOWN = 'UNKNOWN' 28 UNKNOWN = 'UNKNOWN'
18 29
30 # The test did not run.
31 NOTRUN = 'NOTRUN'
32
19 @staticmethod 33 @staticmethod
20 def GetTypes(): 34 def GetTypes():
21 """Get a list of all test types.""" 35 """Get a list of all test types."""
22 return [ResultType.PASS, ResultType.SKIP, ResultType.FAIL, 36 return [ResultType.PASS, ResultType.SKIP, ResultType.FAIL,
23 ResultType.CRASH, ResultType.TIMEOUT, ResultType.UNKNOWN] 37 ResultType.CRASH, ResultType.TIMEOUT, ResultType.UNKNOWN,
38 ResultType.NOTRUN]
24 39
25 40
26 class BaseTestResult(object): 41 class BaseTestResult(object):
27 """Base class for a single test result.""" 42 """Base class for a single test result."""
28 43
29 def __init__(self, name, test_type, duration=0, log=''): 44 def __init__(self, name, test_type, duration=0, log=''):
30 """Construct a BaseTestResult. 45 """Construct a BaseTestResult.
31 46
32 Args: 47 Args:
33 name: Name of the test which defines uniqueness. 48 name: Name of the test which defines uniqueness.
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 return self._GetType(ResultType.UNKNOWN) 242 return self._GetType(ResultType.UNKNOWN)
228 243
229 def GetNotPass(self): 244 def GetNotPass(self):
230 """Get the set of all non-passed test results.""" 245 """Get the set of all non-passed test results."""
231 return self.GetAll() - self.GetPass() 246 return self.GetAll() - self.GetPass()
232 247
233 def DidRunPass(self): 248 def DidRunPass(self):
234 """Return whether the test run was successful.""" 249 """Return whether the test run was successful."""
235 return not self.GetNotPass() - self.GetSkip() 250 return not self.GetNotPass() - self.GetSkip()
236 251
OLDNEW
« no previous file with comments | « no previous file | build/android/pylib/local/device/local_device_gtest_run.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698