2 // ignore-emscripten no processes
3 // ignore-sgx no processes
5 use std::alloc::{Layout, handle_alloc_error};
7 use std::process::Command;
11 if env::args().len() > 1 {
12 handle_alloc_error(Layout::new::<[u8; 42]>())
15 let me = env::current_exe().unwrap();
16 let output = Command::new(&me).arg("next").output().unwrap();
17 assert!(!output.status.success(), "{:?} is a success", output.status);
19 let mut stderr = str::from_utf8(&output.stderr).unwrap();
21 // When running inside QEMU user-mode emulation, there will be an extra message printed by QEMU
22 // in the stderr whenever a core dump happens. Remove it before the check.
24 .strip_suffix("qemu: uncaught target signal 6 (Aborted) - core dumped\n")
27 assert_eq!(stderr, "memory allocation of 42 bytes failed\n");