diff options
| author | Henrik Tjäder <henrik@tjaders.com> | 2023-02-08 22:09:32 +0100 |
|---|---|---|
| committer | Henrik Tjäder <henrik@tjaders.com> | 2023-03-01 00:35:18 +0100 |
| commit | 10a896ab9b0089a5ff9af4870488a6c604887cc0 (patch) | |
| tree | aae043b8db4204cd0639ab3080d8e7ccfcfcaf10 /xtask/src/command.rs | |
| parent | 6742936e0762c2bf3657f444d11beeab1672e913 (diff) | |
xtask: Propagate stdio/stderr, exitcodes
Diffstat (limited to 'xtask/src/command.rs')
| -rw-r--r-- | xtask/src/command.rs | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/xtask/src/command.rs b/xtask/src/command.rs index 07ecc84..d894fae 100644 --- a/xtask/src/command.rs +++ b/xtask/src/command.rs @@ -1,4 +1,4 @@ -use crate::{debug, info, RunResult, Sizearguments, TestRunError}; +use crate::{debug, RunResult, Sizearguments, TestRunError}; use core::fmt; use os_pipe::pipe; use std::{fs::File, io::Read, process::Command}; @@ -315,19 +315,17 @@ pub fn run_command(command: &CargoCommand) -> anyhow::Result<RunResult> { .spawn()?; // retrieve output and clean up - let mut output = String::new(); - reader.read_to_string(&mut output)?; + let mut stdout = String::new(); + reader.read_to_string(&mut stdout)?; let exit_status = handle.wait()?; - let mut error_output = String::new(); - error_reader.read_to_string(&mut error_output)?; - if !error_output.is_empty() { - info!("{error_output}"); - } + let mut stderr = String::new(); + error_reader.read_to_string(&mut stderr)?; Ok(RunResult { exit_status, - output, + stdout, + stderr, }) } @@ -346,10 +344,10 @@ pub fn run_successful(run: &RunResult, expected_output_file: &str) -> Result<(), file: expected_output_file.to_owned(), })?; - if expected_output != run.output { + if expected_output != run.stdout { Err(TestRunError::FileCmpError { expected: expected_output.clone(), - got: run.output.clone(), + got: run.stdout.clone(), }) } else if !run.exit_status.success() { Err(TestRunError::CommandError(run.clone())) |
