Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: tools/test.py

Issue 125248: Make sure to treat tests that time out as having the (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 class TestOutput(object): 365 class TestOutput(object):
366 366
367 def __init__(self, test, command, output): 367 def __init__(self, test, command, output):
368 self.test = test 368 self.test = test
369 self.command = command 369 self.command = command
370 self.output = output 370 self.output = output
371 371
372 def UnexpectedOutput(self): 372 def UnexpectedOutput(self):
373 if self.HasCrashed(): 373 if self.HasCrashed():
374 outcome = CRASH 374 outcome = CRASH
375 elif self.HasTimedOut():
376 outcome = TIMEOUT
375 elif self.HasFailed(): 377 elif self.HasFailed():
376 outcome = FAIL 378 outcome = FAIL
377 else: 379 else:
378 outcome = PASS 380 outcome = PASS
379 return not outcome in self.test.outcomes 381 return not outcome in self.test.outcomes
380 382
381 def HasCrashed(self): 383 def HasCrashed(self):
382 if utils.IsWindows(): 384 if utils.IsWindows():
383 return 0x80000000 & self.output.exit_code and not (0x3FFFFF00 & self.outpu t.exit_code) 385 return 0x80000000 & self.output.exit_code and not (0x3FFFFF00 & self.outpu t.exit_code)
384 else: 386 else:
385 # Timed out tests will have exit_code -signal.SIGTERM. 387 # Timed out tests will have exit_code -signal.SIGTERM.
386 if self.output.timed_out: 388 if self.output.timed_out:
387 return False 389 return False
388 return self.output.exit_code < 0 and \ 390 return self.output.exit_code < 0 and \
389 self.output.exit_code != -signal.SIGABRT 391 self.output.exit_code != -signal.SIGABRT
390 392
391 def HasTimedOut(self): 393 def HasTimedOut(self):
392 return self.output.timed_out; 394 return self.output.timed_out;
393 395
394 def HasFailed(self): 396 def HasFailed(self):
395 execution_failed = self.test.DidFail(self.output) 397 execution_failed = self.test.DidFail(self.output)
396 if self.test.IsNegative(): 398 if self.test.IsNegative():
397 return not execution_failed 399 return not execution_failed
398 else: 400 else:
399 return execution_failed 401 return execution_failed
400 402
401 403
402 def KillProcessWithID(pid): 404 def KillProcessWithID(pid):
403 if utils.IsWindows(): 405 if utils.IsWindows():
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 for entry in timed_tests[:20]: 1333 for entry in timed_tests[:20]:
1332 t = FormatTime(entry.duration) 1334 t = FormatTime(entry.duration)
1333 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel())) 1335 sys.stderr.write("%4i (%s) %s\n" % (index, t, entry.GetLabel()))
1334 index += 1 1336 index += 1
1335 1337
1336 return result 1338 return result
1337 1339
1338 1340
1339 if __name__ == '__main__': 1341 if __name__ == '__main__':
1340 sys.exit(Main()) 1342 sys.exit(Main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698