OLD | NEW |
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 class ResultType(object): | 7 class ResultType(object): |
8 """Class enumerating test types.""" | 8 """Class enumerating test types.""" |
9 PASS = 'PASS' | 9 PASS = 'PASS' |
10 SKIP = 'SKIP' | 10 SKIP = 'SKIP' |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 self._test_type = test_type | 70 self._test_type = test_type |
71 | 71 |
72 def GetType(self): | 72 def GetType(self): |
73 """Get the test result type.""" | 73 """Get the test result type.""" |
74 return self._test_type | 74 return self._test_type |
75 | 75 |
76 def GetDuration(self): | 76 def GetDuration(self): |
77 """Get the test duration.""" | 77 """Get the test duration.""" |
78 return self._duration | 78 return self._duration |
79 | 79 |
80 def SetLog(self, log): | |
81 """Set the test log.""" | |
82 self._log = log | |
83 | |
84 def GetLog(self): | 80 def GetLog(self): |
85 """Get the test log.""" | 81 """Get the test log.""" |
86 return self._log | 82 return self._log |
87 | 83 |
88 | 84 |
89 class TestRunResults(object): | 85 class TestRunResults(object): |
90 """Set of results for a test run.""" | 86 """Set of results for a test run.""" |
91 | 87 |
92 def __init__(self): | 88 def __init__(self): |
93 self._results = set() | 89 self._results = set() |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 return self._GetType(ResultType.UNKNOWN) | 203 return self._GetType(ResultType.UNKNOWN) |
208 | 204 |
209 def GetNotPass(self): | 205 def GetNotPass(self): |
210 """Get the set of all non-passed test results.""" | 206 """Get the set of all non-passed test results.""" |
211 return self.GetAll() - self.GetPass() | 207 return self.GetAll() - self.GetPass() |
212 | 208 |
213 def DidRunPass(self): | 209 def DidRunPass(self): |
214 """Return whether the test run was successful.""" | 210 """Return whether the test run was successful.""" |
215 return not self.GetNotPass() - self.GetSkip() | 211 return not self.GetNotPass() - self.GetSkip() |
216 | 212 |
OLD | NEW |