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/spawn.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'runtime/ops/spawn.rs') diff --git a/runtime/ops/spawn.rs b/runtime/ops/spawn.rs index 9ec1937af..0f329e16e 100644 --- a/runtime/ops/spawn.rs +++ b/runtime/ops/spawn.rs @@ -4,6 +4,7 @@ use super::io::ChildStderrResource; use super::io::ChildStdinResource; use super::io::ChildStdoutResource; use super::process::Stdio; +use super::process::StdioOrRid; use crate::permissions::Permissions; use deno_core::error::AnyError; use deno_core::op; @@ -147,8 +148,14 @@ fn create_command( } command.stdin(args.stdio.stdin.as_stdio()); - command.stdout(args.stdio.stdout.as_stdio()); - command.stderr(args.stdio.stderr.as_stdio()); + command.stdout(match args.stdio.stdout { + Stdio::Inherit => StdioOrRid::Rid(1).as_stdio(state)?, + value => value.as_stdio(), + }); + command.stderr(match args.stdio.stderr { + Stdio::Inherit => StdioOrRid::Rid(2).as_stdio(state)?, + value => value.as_stdio(), + }); Ok(command) } -- cgit v1.2.3