OLD | NEW |
1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
4 # met: | 4 # met: |
5 # | 5 # |
6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 def IsNegativeTest(self, testcase): | 183 def IsNegativeTest(self, testcase): |
184 return False | 184 return False |
185 | 185 |
186 def HasFailed(self, testcase): | 186 def HasFailed(self, testcase): |
187 execution_failed = self.IsFailureOutput(testcase.output, testcase.path) | 187 execution_failed = self.IsFailureOutput(testcase.output, testcase.path) |
188 if self.IsNegativeTest(testcase): | 188 if self.IsNegativeTest(testcase): |
189 return not execution_failed | 189 return not execution_failed |
190 else: | 190 else: |
191 return execution_failed | 191 return execution_failed |
192 | 192 |
| 193 def GetOutcome(self, testcase): |
| 194 if testcase.output.HasCrashed(): |
| 195 return statusfile.CRASH |
| 196 elif testcase.output.HasTimedOut(): |
| 197 return statusfile.TIMEOUT |
| 198 elif self.HasFailed(testcase): |
| 199 return statusfile.FAIL |
| 200 else: |
| 201 return statusfile.PASS |
| 202 |
193 def HasUnexpectedOutput(self, testcase): | 203 def HasUnexpectedOutput(self, testcase): |
194 if testcase.output.HasCrashed(): | 204 outcome = self.GetOutcome(testcase) |
195 outcome = statusfile.CRASH | 205 return not outcome in (testcase.outcomes or [statusfile.PASS]) |
196 elif testcase.output.HasTimedOut(): | |
197 outcome = statusfile.TIMEOUT | |
198 elif self.HasFailed(testcase): | |
199 outcome = statusfile.FAIL | |
200 else: | |
201 outcome = statusfile.PASS | |
202 if not testcase.outcomes: | |
203 return outcome != statusfile.PASS | |
204 return not outcome in testcase.outcomes | |
205 | 206 |
206 def StripOutputForTransmit(self, testcase): | 207 def StripOutputForTransmit(self, testcase): |
207 if not self.HasUnexpectedOutput(testcase): | 208 if not self.HasUnexpectedOutput(testcase): |
208 testcase.output.stdout = "" | 209 testcase.output.stdout = "" |
209 testcase.output.stderr = "" | 210 testcase.output.stderr = "" |
210 | 211 |
211 def CalculateTotalDuration(self): | 212 def CalculateTotalDuration(self): |
212 self.total_duration = 0.0 | 213 self.total_duration = 0.0 |
213 for t in self.tests: | 214 for t in self.tests: |
214 self.total_duration += t.duration | 215 self.total_duration += t.duration |
215 return self.total_duration | 216 return self.total_duration |
OLD | NEW |