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

Side by Side Diff: tools/testrunner/objects/output.py

Issue 371363003: Add predictable mode to test driver. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Extra flag. Created 6 years, 5 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 | « tools/testrunner/objects/context.py ('k') | 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 # 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 20 matching lines...) Expand all
31 from ..local import utils 31 from ..local import utils
32 32
33 class Output(object): 33 class Output(object):
34 34
35 def __init__(self, exit_code, timed_out, stdout, stderr): 35 def __init__(self, exit_code, timed_out, stdout, stderr):
36 self.exit_code = exit_code 36 self.exit_code = exit_code
37 self.timed_out = timed_out 37 self.timed_out = timed_out
38 self.stdout = stdout 38 self.stdout = stdout
39 self.stderr = stderr 39 self.stderr = stderr
40 40
41 def __ne__(self, other):
42 return (self.exit_code != other.exit_code or
43 self.timed_out != other.timed_out or
44 self.stdout != other.stdout or
45 self.stderr != other.stderr)
46
41 def HasCrashed(self): 47 def HasCrashed(self):
42 if utils.IsWindows(): 48 if utils.IsWindows():
43 return 0x80000000 & self.exit_code and not (0x3FFFFF00 & self.exit_code) 49 return 0x80000000 & self.exit_code and not (0x3FFFFF00 & self.exit_code)
44 else: 50 else:
45 # Timed out tests will have exit_code -signal.SIGTERM. 51 # Timed out tests will have exit_code -signal.SIGTERM.
46 if self.timed_out: 52 if self.timed_out:
47 return False 53 return False
48 return (self.exit_code < 0 and 54 return (self.exit_code < 0 and
49 self.exit_code != -signal.SIGABRT) 55 self.exit_code != -signal.SIGABRT)
50 56
51 def HasTimedOut(self): 57 def HasTimedOut(self):
52 return self.timed_out 58 return self.timed_out
53 59
54 def Pack(self): 60 def Pack(self):
55 return [self.exit_code, self.timed_out, self.stdout, self.stderr] 61 return [self.exit_code, self.timed_out, self.stdout, self.stderr]
56 62
57 @staticmethod 63 @staticmethod
58 def Unpack(packed): 64 def Unpack(packed):
59 # For the order of the fields, refer to Pack() above. 65 # For the order of the fields, refer to Pack() above.
60 return Output(packed[0], packed[1], packed[2], packed[3]) 66 return Output(packed[0], packed[1], packed[2], packed[3])
OLDNEW
« no previous file with comments | « tools/testrunner/objects/context.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698