From a1b4aa2ae60d215e38c6871fae690e34964a27d7 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 26 Apr 2022 14:46:49 -0400 Subject: fix(test): capture inherited stdout and stderr for subprocesses in test output (#14395) --- runtime/ops/process.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'runtime/ops/process.rs') 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 { // 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); -- cgit v1.2.3