summaryrefslogtreecommitdiff
path: root/runtime/ops/process.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-04-26 14:46:49 -0400
committerGitHub <noreply@github.com>2022-04-26 14:46:49 -0400
commita1b4aa2ae60d215e38c6871fae690e34964a27d7 (patch)
treec41baf3067ca2a618bd458f1101bf9cf98506dae /runtime/ops/process.rs
parentf07f246ae8a158e33e81aa4ccf225cd536795f50 (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.rs16
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);