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/spawn.rs | |
parent | f07f246ae8a158e33e81aa4ccf225cd536795f50 (diff) |
fix(test): capture inherited stdout and stderr for subprocesses in test output (#14395)
Diffstat (limited to 'runtime/ops/spawn.rs')
-rw-r--r-- | runtime/ops/spawn.rs | 11 |
1 files changed, 9 insertions, 2 deletions
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) } |