From cf94bdc0742c13e2a0cac864c478b8626b266e1b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/alloc-error/default-alloc-error-hook.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/test/ui/alloc-error/default-alloc-error-hook.rs') diff --git a/src/test/ui/alloc-error/default-alloc-error-hook.rs b/src/test/ui/alloc-error/default-alloc-error-hook.rs index 100e97497..8be09500f 100644 --- a/src/test/ui/alloc-error/default-alloc-error-hook.rs +++ b/src/test/ui/alloc-error/default-alloc-error-hook.rs @@ -15,5 +15,14 @@ fn main() { let me = env::current_exe().unwrap(); let output = Command::new(&me).arg("next").output().unwrap(); assert!(!output.status.success(), "{:?} is a success", output.status); - assert_eq!(str::from_utf8(&output.stderr).unwrap(), "memory allocation of 42 bytes failed\n"); + + let mut stderr = str::from_utf8(&output.stderr).unwrap(); + + // When running inside QEMU user-mode emulation, there will be an extra message printed by QEMU + // in the stderr whenever a core dump happens. Remove it before the check. + stderr = stderr + .strip_suffix("qemu: uncaught target signal 6 (Aborted) - core dumped\n") + .unwrap_or(stderr); + + assert_eq!(stderr, "memory allocation of 42 bytes failed\n"); } -- cgit v1.2.3