2 #![allow(unused_variables)]
3 // compile-flags:--test -g
4 // ignore-asmjs wasm2js does not support source maps yet
6 #[cfg(target_os = "macos")]
9 use std::{env, panic, fs};
11 // Find our dSYM and replace the DWARF binary with an empty file
12 let mut dsym_path = env::current_exe().unwrap();
13 let executable_name = dsym_path.file_name().unwrap().to_str().unwrap().to_string();
14 assert!(dsym_path.pop()); // Pop executable
15 dsym_path.push(format!("{}.dSYM/Contents/Resources/DWARF/{0}", executable_name));
17 let file = fs::OpenOptions::new().read(false).write(true).truncate(true).create(false)
18 .open(&dsym_path).unwrap();
21 env::set_var("RUST_BACKTRACE", "1");
23 // We don't need to die of panic, just trigger a backtrace
24 let _ = panic::catch_unwind(|| {