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)
| 70 | pass |
| 71 | |
| 72 | def 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 | |
| 91 | def runner(arguments, environment = None, input = None, timeout = 5, workingDirectory = None): |
| 92 | """Starts subprocess and waits until it terminates. |