diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:13:23 +0000 |
commit | 20431706a863f92cb37dc512fef6e48d192aaf2c (patch) | |
tree | 2867f13f5fd5437ba628c67d7f87309ccadcd286 /src/test/ui/alloc-error | |
parent | Releasing progress-linux version 1.65.0+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.tar.xz rustc-20431706a863f92cb37dc512fef6e48d192aaf2c.zip |
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/alloc-error')
-rw-r--r-- | src/test/ui/alloc-error/default-alloc-error-hook.rs | 11 |
1 files changed, 10 insertions, 1 deletions
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"); } |