MCPcopy Index your code
hub / github.com/nodejs/node / Output

Class Output

deps/v8/tools/testrunner/objects/output.py:36–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35
36class Output(object):
37
38 def __init__(self, exit_code=0, timed_out=False, stdout=None, stderr=None,
39 pid=None, start_time=0, end_time=0, stats=None):
40 self.exit_code = exit_code
41 self.timed_out = timed_out
42 self.stdout = stdout
43 self.stderr = stderr
44 self.pid = pid
45 self.start_time = start_time
46 self.end_time = end_time
47 self.stats = stats or ProcessStats()
48
49 @property
50 def duration(self):
51 return self.end_time - self.start_time
52
53 def without_text(self):
54 """Returns copy of the output without stdout and stderr."""
55 other = copy.copy(self)
56 other.stdout = None
57 other.stderr = None
58 return other
59
60 def HasCrashed(self):
61 if utils.IsWindows():
62 return 0x80000000 & self.exit_code and not (0x3FFFFF00 & self.exit_code)
63 else:
64 # Timed out tests will have exit_code -signal.SIGTERM.
65 if self.timed_out:
66 return False
67 return (self.exit_code < 0 and
68 self.exit_code != -signal.SIGABRT)
69
70 def HasTimedOut(self):
71 return self.timed_out
72
73 def IsSuccess(self):
74 return not self.HasCrashed() and not self.HasTimedOut()
75
76 @property
77 def exit_code_string(self):
78 return "%d [%02X]" % (self.exit_code, self.exit_code & 0xffffffff)
79
80
81class _NullOutput(Output):

Callers 5

_RunMethod · 0.90
_RunMethod · 0.90
_MockCommandMethod · 0.90
testAndroidMethod · 0.90
mock_resultFunction · 0.90

Calls

no outgoing calls

Tested by 3

_MockCommandMethod · 0.72
testAndroidMethod · 0.72
mock_resultFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…