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 |
80 def GetLog(self): | 84 def GetLog(self): |
81 """Get the test log.""" | 85 """Get the test log.""" |
82 return self._log | 86 return self._log |
83 | 87 |
84 | 88 |
85 class TestRunResults(object): | 89 class TestRunResults(object): |
86 """Set of results for a test run.""" | 90 """Set of results for a test run.""" |
87 | 91 |
88 def __init__(self): | 92 def __init__(self): |
89 self._results = set() | 93 self._results = set() |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 return self._GetType(ResultType.UNKNOWN) | 207 return self._GetType(ResultType.UNKNOWN) |
204 | 208 |
205 def GetNotPass(self): | 209 def GetNotPass(self): |
206 """Get the set of all non-passed test results.""" | 210 """Get the set of all non-passed test results.""" |
207 return self.GetAll() - self.GetPass() | 211 return self.GetAll() - self.GetPass() |
208 | 212 |
209 def DidRunPass(self): | 213 def DidRunPass(self): |
210 """Return whether the test run was successful.""" | 214 """Return whether the test run was successful.""" |
211 return not self.GetNotPass() - self.GetSkip() | 215 return not self.GetNotPass() - self.GetSkip() |
212 | 216 |
OLD | NEW |