diff options
Diffstat (limited to 'xtask/src')
| -rw-r--r-- | xtask/src/command.rs | 28 | ||||
| -rw-r--r-- | xtask/src/main.rs | 4 |
2 files changed, 27 insertions, 5 deletions
diff --git a/xtask/src/command.rs b/xtask/src/command.rs index a1c4d25..a45cb8a 100644 --- a/xtask/src/command.rs +++ b/xtask/src/command.rs @@ -383,6 +383,7 @@ impl<'a> CargoCommand<'a> { if let Some(cargoarg) = cargoarg { args.extend_from_slice(&[cargoarg]); } + args.extend_from_slice(&[ self.command(), "--example", @@ -407,9 +408,15 @@ impl<'a> CargoCommand<'a> { mode, } => { let mut args = vec!["+nightly"]; + if let Some(cargoarg) = cargoarg { args.extend_from_slice(&[cargoarg]); } + + // We need to be in the `rtic` directory to pick up + // the correct .cargo/config.toml file + args.extend_from_slice(&["-Z", "unstable-options", "-C", "rtic"]); + args.extend_from_slice(&[ self.command(), "--example", @@ -641,6 +648,11 @@ impl<'a> CargoCommand<'a> { if let Some(cargoarg) = cargoarg { args.extend_from_slice(&[cargoarg]); } + + // We need to be in the `rtic` directory to pick up + // the correct .cargo/config.toml file + args.extend_from_slice(&["-Z", "unstable-options", "-C", "rtic"]); + args.extend_from_slice(&[ self.command(), "--example", @@ -694,6 +706,13 @@ impl<'a> CargoCommand<'a> { _ => None, } } + + pub fn print_stdout_intermediate(&self) -> bool { + match self { + Self::ExampleSize { .. } => true, + _ => false, + } + } } impl BuildMode { @@ -737,6 +756,10 @@ pub fn run_command(command: &CargoCommand, stderr_mode: OutputMode) -> anyhow::R let stderr = String::from_utf8(result.stderr).unwrap_or("Not displayable".into()); let stdout = String::from_utf8(result.stdout).unwrap_or("Not displayable".into()); + if command.print_stdout_intermediate() && exit_status.success() { + log::info!("\n{}", stdout); + } + Ok(RunResult { exit_status, stdout, @@ -850,9 +873,8 @@ pub fn handle_results(globals: &Globals, results: Vec<FinalRunResult>) -> Result .clone() .for_each(|(cmd, error)| error!("❌ Failed: {cmd}\n {}\n{error}", cmd.as_cmd_string())); - let ecount = errors.count(); - let cecount = command_errors.count(); - if ecount != 0 || cecount != 0 { + let ecount = errors.count() + command_errors.count(); + if ecount != 0 { log::error!("{ecount} commands failed."); Err(()) } else { diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 10499c0..7077d55 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -100,8 +100,8 @@ impl fmt::Display for TestRunError { TestRunError::CommandError(e) => { write!( f, - "Command failed with exit status {}: {}", - e.exit_status, e.stdout + "Command failed with exit status {}: {} {}", + e.exit_status, e.stdout, e.stderr ) } TestRunError::PathConversionError(p) => { |
