From 6d9175f98e78118dd2467f285b16663842be5b61 Mon Sep 17 00:00:00 2001 From: Matthias Krüger Date: Sat, 30 Mar 2024 00:41:57 +0100 Subject: crashes: fix ice detection which did not trigger if code compiled without error by accident --- src/tools/compiletest/src/runtest.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 9b98e78b15b..759b07abc6e 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -364,13 +364,16 @@ impl<'test> TestCx<'test> { fn run_crash_test(&self) { let pm = self.pass_mode(); let proc_res = self.compile_test(WillExecute::No, self.should_emit_metadata(pm)); + /* + eprintln!("{}", proc_res.status); + eprintln!("{}", proc_res.stdout); + eprintln!("{}", proc_res.stderr); + eprintln!("{}", proc_res.cmdline); + */ // if a test does not crash, consider it an error - if !proc_res.status.success() { - match proc_res.status.code() { - Some(1 | 0) => self.fatal(&format!("test no longer crashes/triggers ICE! Please annotate it and add it as test to tests/ui or wherever you see fit")), - _ => (), - } + if proc_res.status.success() || matches!(proc_res.status.code(), Some(1 | 0)) { + self.fatal(&format!("test no longer crashes/triggers ICE! Please annotate it and add it as test to tests/ui or wherever you see fit")); } } @@ -2322,9 +2325,6 @@ impl<'test> TestCx<'test> { } let (Output { status, stdout, stderr }, truncated) = self.read2_abbreviated(child); - eprintln!("{:?}", status); - eprintln!("{}", String::from_utf8_lossy(&stdout).into_owned()); - eprintln!("{}", String::from_utf8_lossy(&stdout).into_owned()); let result = ProcRes { status, -- cgit 1.4.1-3-g733a5