OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 | 5 |
6 import logging | 6 import logging |
7 | 7 |
8 | 8 |
9 # Language values match constants in Sponge protocol buffer (sponge.proto). | 9 # Language values match constants in Sponge protocol buffer (sponge.proto). |
10 JAVA = 5 | 10 JAVA = 5 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 self.ok = [] | 54 self.ok = [] |
55 self.failed = [] | 55 self.failed = [] |
56 self.crashed = [] | 56 self.crashed = [] |
57 self.unknown = [] | 57 self.unknown = [] |
58 self.disabled = [] | 58 self.disabled = [] |
59 self.unexpected_pass = [] | 59 self.unexpected_pass = [] |
60 self.timed_out = False | 60 self.timed_out = False |
61 self.overall_fail = False | 61 self.overall_fail = False |
62 | 62 |
63 @staticmethod | 63 @staticmethod |
64 def FromOkAndFailed(ok, failed, timed_out, overall_fail): | 64 def FromRun(ok=None, failed=None, crashed=None, timed_out=False, |
| 65 overall_fail=False): |
65 ret = TestResults() | 66 ret = TestResults() |
66 ret.ok = ok | 67 ret.ok = ok or [] |
67 ret.failed = failed | 68 ret.failed = failed or [] |
| 69 ret.crashed = crashed or [] |
68 ret.timed_out = timed_out | 70 ret.timed_out = timed_out |
69 ret.overall_fail = overall_fail | 71 ret.overall_fail = overall_fail |
70 return ret | 72 return ret |
71 | 73 |
72 @staticmethod | 74 @staticmethod |
73 def FromTestResults(results): | 75 def FromTestResults(results): |
74 """Combines a list of results in a single TestResults object.""" | 76 """Combines a list of results in a single TestResults object.""" |
75 ret = TestResults() | 77 ret = TestResults() |
76 for t in results: | 78 for t in results: |
77 ret.ok += t.ok | 79 ret.ok += t.ok |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 len(self.crashed) + len(self.unknown)) | 121 len(self.crashed) + len(self.unknown)) |
120 summary_string += 'PASSED=%d\n' % (len(self.ok)) | 122 summary_string += 'PASSED=%d\n' % (len(self.ok)) |
121 summary_string += 'FAILED=%d %s\n' % (len(self.failed), | 123 summary_string += 'FAILED=%d %s\n' % (len(self.failed), |
122 [t.name for t in self.failed]) | 124 [t.name for t in self.failed]) |
123 summary_string += 'CRASHED=%d %s\n' % (len(self.crashed), | 125 summary_string += 'CRASHED=%d %s\n' % (len(self.crashed), |
124 [t.name for t in self.crashed]) | 126 [t.name for t in self.crashed]) |
125 summary_string += 'UNKNOWN=%d %s\n' % (len(self.unknown), | 127 summary_string += 'UNKNOWN=%d %s\n' % (len(self.unknown), |
126 [t.name for t in self.unknown]) | 128 [t.name for t in self.unknown]) |
127 logging.critical(summary_string) | 129 logging.critical(summary_string) |
128 return summary_string | 130 return summary_string |
OLD | NEW |