From fb3ac74696d64f02e3e75e563a9e378b8b3886bc Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 19 Jul 2022 14:40:17 -0400 Subject: [PATCH 1/2] on an error, always print the unnormalized stderr --- ui_test/src/lib.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/ui_test/src/lib.rs b/ui_test/src/lib.rs index 16f7be30f8b..568e39f5670 100644 --- a/ui_test/src/lib.rs +++ b/ui_test/src/lib.rs @@ -172,7 +172,6 @@ pub fn run_tests(config: Config) -> Result<()> { eprintln!(); eprintln!("command: {:?}", miri); eprintln!(); - let mut dump_stderr = true; for error in errors { match error { Error::ExitStatus(mode, exit_status) => eprintln!("{mode:?} got {exit_status}"), @@ -194,9 +193,6 @@ pub fn run_tests(config: Config) -> Result<()> { Error::PatternFoundInPassTest => eprintln!("{}", "error pattern found in success test".red()), Error::OutputDiffers { path, actual, expected } => { - if path.extension().unwrap() == "stderr" { - dump_stderr = false; - } eprintln!("actual output differed from expected {}", path.display()); eprintln!("{}", pretty_assertions::StrComparison::new(expected, actual)); eprintln!() @@ -223,12 +219,9 @@ pub fn run_tests(config: Config) -> Result<()> { } eprintln!(); } - // Unless we already dumped the stderr via an OutputDiffers diff, let's dump it here. - if dump_stderr { - eprintln!("actual stderr:"); - eprintln!("{}", stderr); - eprintln!(); - } + eprintln!("full stderr:"); + eprintln!("{}", stderr); + eprintln!(); } eprintln!("{}", "failures:".red().underline()); for (path, _miri, _revision, _errors, _stderr) in &failures { From 9f9aa00f5d4900c2ec4071fd80ac184f9f95f718 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 19 Jul 2022 14:44:00 -0400 Subject: [PATCH 2/2] tweak failure output a little --- ui_test/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui_test/src/lib.rs b/ui_test/src/lib.rs index 568e39f5670..917e382379a 100644 --- a/ui_test/src/lib.rs +++ b/ui_test/src/lib.rs @@ -164,11 +164,11 @@ pub fn run_tests(config: Config) -> Result<()> { if !failures.is_empty() { for (path, miri, revision, errors, stderr) in &failures { eprintln!(); - eprint!("{}", path.display().to_string().underline()); + eprint!("{}", path.display().to_string().underline().bold()); if !revision.is_empty() { eprint!(" (revision `{}`)", revision); } - eprint!(" {}", "FAILED".red()); + eprint!(" {}", "FAILED:".red().bold()); eprintln!(); eprintln!("command: {:?}", miri); eprintln!(); @@ -223,7 +223,7 @@ pub fn run_tests(config: Config) -> Result<()> { eprintln!("{}", stderr); eprintln!(); } - eprintln!("{}", "failures:".red().underline()); + eprintln!("{}", "FAILURES:".red().underline().bold()); for (path, _miri, _revision, _errors, _stderr) in &failures { eprintln!(" {}", path.display()); }