MCPcopy Create free account
hub / github.com/nodejs/node / _create_result

Method _create_result

deps/v8/tools/testrunner/outproc/base.py:35–52  ·  view source on GitHub ↗

Creates Result instance. When reduction is passed it tries to drop some parts of the result to save memory and time needed to send the result across process boundary. None disables reduction and full result is created.

(self, has_unexpected_output, output, reduction)

Source from the content-addressed store, hash-verified

33 return self.get_outcome(output) not in self.expected_outcomes
34
35 def _create_result(self, has_unexpected_output, output, reduction):
36 """Creates Result instance. When reduction is passed it tries to drop some
37 parts of the result to save memory and time needed to send the result
38 across process boundary. None disables reduction and full result is created.
39 """
40 if reduction == DROP_RESULT:
41 return None
42 error_details = \
43 self._get_error_details(output) if has_unexpected_output else None
44 if reduction == DROP_OUTPUT:
45 return Result(has_unexpected_output, None, error_details=error_details)
46 if not has_unexpected_output:
47 if reduction == DROP_PASS_OUTPUT:
48 return Result(has_unexpected_output, None)
49 if reduction == DROP_PASS_STDOUT:
50 return Result(has_unexpected_output, output.without_text())
51
52 return Result(has_unexpected_output, output, error_details=error_details)
53
54 def get_outcome(self, output):
55 if output.HasCrashed():

Callers 1

processMethod · 0.95

Calls 3

_get_error_detailsMethod · 0.95
without_textMethod · 0.80
ResultClass · 0.50

Tested by

no test coverage detected