OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2008 the V8 project authors. All rights reserved. | 3 # Copyright 2008 the V8 project authors. All rights reserved. |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 self.PrintFailureHeader(failed.test) | 157 self.PrintFailureHeader(failed.test) |
158 if failed.output.stderr: | 158 if failed.output.stderr: |
159 print "--- stderr ---" | 159 print "--- stderr ---" |
160 print failed.output.stderr.strip() | 160 print failed.output.stderr.strip() |
161 if failed.output.stdout: | 161 if failed.output.stdout: |
162 print "--- stdout ---" | 162 print "--- stdout ---" |
163 print failed.output.stdout.strip() | 163 print failed.output.stdout.strip() |
164 print "Command: %s" % EscapeCommand(failed.command) | 164 print "Command: %s" % EscapeCommand(failed.command) |
165 if failed.HasCrashed(): | 165 if failed.HasCrashed(): |
166 print "--- CRASHED ---" | 166 print "--- CRASHED ---" |
| 167 if failed.HasTimedOut(): |
| 168 print "--- TIMEOUT ---" |
167 if len(self.failed) == 0: | 169 if len(self.failed) == 0: |
168 print "===" | 170 print "===" |
169 print "=== All tests succeeded" | 171 print "=== All tests succeeded" |
170 print "===" | 172 print "===" |
171 else: | 173 else: |
172 print | 174 print |
173 print "===" | 175 print "===" |
174 print "=== %i tests failed" % len(self.failed) | 176 print "=== %i tests failed" % len(self.failed) |
175 if self.crashed > 0: | 177 if self.crashed > 0: |
176 print "=== %i tests CRASHED" % self.crashed | 178 print "=== %i tests CRASHED" % self.crashed |
(...skipping 23 matching lines...) Expand all Loading... |
200 pass | 202 pass |
201 | 203 |
202 def HasRun(self, output): | 204 def HasRun(self, output): |
203 total = self.succeeded + len(self.failed) | 205 total = self.succeeded + len(self.failed) |
204 if (total > 1) and (total % 50 == 1): | 206 if (total > 1) and (total % 50 == 1): |
205 sys.stdout.write('\n') | 207 sys.stdout.write('\n') |
206 if output.UnexpectedOutput(): | 208 if output.UnexpectedOutput(): |
207 if output.HasCrashed(): | 209 if output.HasCrashed(): |
208 sys.stdout.write('C') | 210 sys.stdout.write('C') |
209 sys.stdout.flush() | 211 sys.stdout.flush() |
| 212 elif output.HasTimedOut(): |
| 213 sys.stdout.write('T') |
| 214 sys.stdout.flush() |
210 else: | 215 else: |
211 sys.stdout.write('F') | 216 sys.stdout.write('F') |
212 sys.stdout.flush() | 217 sys.stdout.flush() |
213 else: | 218 else: |
214 sys.stdout.write('.') | 219 sys.stdout.write('.') |
215 sys.stdout.flush() | 220 sys.stdout.flush() |
216 | 221 |
217 | 222 |
218 class CompactProgressIndicator(ProgressIndicator): | 223 class CompactProgressIndicator(ProgressIndicator): |
219 | 224 |
(...skipping 18 matching lines...) Expand all Loading... |
238 self.PrintFailureHeader(output.test) | 243 self.PrintFailureHeader(output.test) |
239 stdout = output.output.stdout.strip() | 244 stdout = output.output.stdout.strip() |
240 if len(stdout): | 245 if len(stdout): |
241 print self.templates['stdout'] % stdout | 246 print self.templates['stdout'] % stdout |
242 stderr = output.output.stderr.strip() | 247 stderr = output.output.stderr.strip() |
243 if len(stderr): | 248 if len(stderr): |
244 print self.templates['stderr'] % stderr | 249 print self.templates['stderr'] % stderr |
245 print "Command: %s" % EscapeCommand(output.command) | 250 print "Command: %s" % EscapeCommand(output.command) |
246 if output.HasCrashed(): | 251 if output.HasCrashed(): |
247 print "--- CRASHED ---" | 252 print "--- CRASHED ---" |
| 253 if output.HasTimedOut(): |
| 254 print "--- TIMEOUT ---" |
248 | 255 |
249 def Truncate(self, str, length): | 256 def Truncate(self, str, length): |
250 if length and (len(str) > (length - 3)): | 257 if length and (len(str) > (length - 3)): |
251 return str[:(length-3)] + "..." | 258 return str[:(length-3)] + "..." |
252 else: | 259 else: |
253 return str | 260 return str |
254 | 261 |
255 def PrintProgress(self, name): | 262 def PrintProgress(self, name): |
256 self.ClearLine(self.last_status_length) | 263 self.ClearLine(self.last_status_length) |
257 elapsed = time.time() - self.start_time | 264 elapsed = time.time() - self.start_time |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 def HasCrashed(self): | 381 def HasCrashed(self): |
375 if utils.IsWindows(): | 382 if utils.IsWindows(): |
376 return 0x80000000 & self.output.exit_code and not (0x3FFFFF00 & self.outpu
t.exit_code) | 383 return 0x80000000 & self.output.exit_code and not (0x3FFFFF00 & self.outpu
t.exit_code) |
377 else: | 384 else: |
378 # Timed out tests will have exit_code -signal.SIGTERM. | 385 # Timed out tests will have exit_code -signal.SIGTERM. |
379 if self.output.timed_out: | 386 if self.output.timed_out: |
380 return False | 387 return False |
381 return self.output.exit_code < 0 and \ | 388 return self.output.exit_code < 0 and \ |
382 self.output.exit_code != -signal.SIGABRT | 389 self.output.exit_code != -signal.SIGABRT |
383 | 390 |
| 391 def HasTimedOut(self): |
| 392 return self.output.timed_out; |
| 393 |
384 def HasFailed(self): | 394 def HasFailed(self): |
385 execution_failed = self.test.DidFail(self.output) | 395 execution_failed = self.test.DidFail(self.output) |
386 if self.test.IsNegative(): | 396 if self.test.IsNegative(): |
387 return not execution_failed | 397 return not execution_failed |
388 else: | 398 else: |
389 return execution_failed | 399 return execution_failed |
390 | 400 |
391 | 401 |
392 def KillProcessWithID(pid): | 402 def KillProcessWithID(pid): |
393 if utils.IsWindows(): | 403 if utils.IsWindows(): |
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 for entry in timed_tests[:20]: | 1331 for entry in timed_tests[:20]: |
1322 t = FormatTime(entry.duration) | 1332 t = FormatTime(entry.duration) |
1323 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) | 1333 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) |
1324 index += 1 | 1334 index += 1 |
1325 | 1335 |
1326 return result | 1336 return result |
1327 | 1337 |
1328 | 1338 |
1329 if __name__ == '__main__': | 1339 if __name__ == '__main__': |
1330 sys.exit(Main()) | 1340 sys.exit(Main()) |
OLD | NEW |