This commit is contained in:
Anton-4 2023-12-26 13:26:31 +01:00
parent 9e6ca69843
commit 0987be4c2d
No known key found for this signature in database
GPG key ID: 0971D718C0A9B937
3 changed files with 11 additions and 6 deletions

View file

@ -250,12 +250,18 @@ pub fn run_cmd<'a, I: IntoIterator<Item = &'a str>, E: IntoIterator<Item = (&'a
let cmd_str = pretty_command_string(&cmd);
dbg!(cmd
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn());
let mut child = cmd
.stdin(Stdio::piped())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()
.unwrap_or_else(|_| panic!("failed to execute cmd `{cmd_name}` in CLI test"));
.unwrap_or_else(|_| panic!("Failed to execute cmd:\n\t`{:?}`", cmd_str));
{
let stdin = child.stdin.as_mut().expect("Failed to open stdin");
@ -269,7 +275,7 @@ pub fn run_cmd<'a, I: IntoIterator<Item = &'a str>, E: IntoIterator<Item = (&'a
let output = child
.wait_with_output()
.unwrap_or_else(|_| panic!("failed to execute cmd `{cmd_name}` in CLI test"));
.unwrap_or_else(|_| panic!("Failed to execute cmd:\n\t`{:?}`", cmd_str));
Out {
cmd_str,