diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-04-26 14:46:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 14:46:49 -0400 |
commit | a1b4aa2ae60d215e38c6871fae690e34964a27d7 (patch) | |
tree | c41baf3067ca2a618bd458f1101bf9cf98506dae /runtime/ops/process.rs | |
parent | f07f246ae8a158e33e81aa4ccf225cd536795f50 (diff) |
fix(test): capture inherited stdout and stderr for subprocesses in test output (#14395)
Diffstat (limited to 'runtime/ops/process.rs')
-rw-r--r-- | runtime/ops/process.rs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs index 8261e9eb4..e22ed3ac3 100644 --- a/runtime/ops/process.rs +++ b/runtime/ops/process.rs @@ -186,8 +186,20 @@ fn op_run(state: &mut OpState, run_args: RunArgs) -> Result<RunInfo, AnyError> { // TODO: make this work with other resources, eg. sockets c.stdin(run_args.stdin.as_stdio(state)?); - c.stdout(run_args.stdout.as_stdio(state)?); - c.stderr(run_args.stderr.as_stdio(state)?); + c.stdout( + match run_args.stdout { + StdioOrRid::Stdio(Stdio::Inherit) => StdioOrRid::Rid(1), + value => value, + } + .as_stdio(state)?, + ); + c.stderr( + match run_args.stderr { + StdioOrRid::Stdio(Stdio::Inherit) => StdioOrRid::Rid(2), + value => value, + } + .as_stdio(state)?, + ); // We want to kill child when it's closed c.kill_on_drop(true); |