MCPcopy Create free account
hub / github.com/DISTORTEC/distortos / error

Function error

scripts/runTest.py:72–89  ·  view source on GitHub ↗

Prints info about errored subprocess and raises `TestError` exception. * `arguments` is a list with program name and its arguments * `input` is the string passed to stdin of subprocess * `returncode` is the return code of the subprocess * `stderr` is the stderr of the subprocess * `stdout` is

(arguments, input, returncode, stderr, stdout)

Source from the content-addressed store, hash-verified

70 pass
71
72def error(arguments, input, returncode, stderr, stdout):
73 """Prints info about errored subprocess and raises `TestError` exception.
74
75 * `arguments` is a list with program name and its arguments
76 * `input` is the string passed to stdin of subprocess
77 * `returncode` is the return code of the subprocess
78 * `stderr` is the stderr of the subprocess
79 * `stdout` is the stdout of the subprocess
80 """
81
82 print('Subprocess \'{}\' failed, return code = {}'.format(' '.join(arguments), returncode))
83 if input:
84 print(' input:\n{}'.format(textwrap.indent(input.strip(), ' ')))
85 if stderr:
86 print(' stderr:\n{}'.format(textwrap.indent(stderr.strip(), ' ')))
87 if stdout:
88 print(' stdout:\n{}'.format(textwrap.indent(stdout.strip(), ' ')))
89 raise TestError
90
91def runner(arguments, environment = None, input = None, timeout = 5, workingDirectory = None):
92 """Starts subprocess and waits until it terminates.

Callers 2

runnerFunction · 0.85
runTest.pyFile · 0.85

Calls 4

printFunction · 0.85
formatMethod · 0.80
joinMethod · 0.45
indentMethod · 0.45

Tested by

no test coverage detected