]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
0bf4aa26 | 2 | #![allow(unused_variables)] |
ea8adc8c | 3 | // compile-flags:--test -g |
e74abb32 | 4 | // ignore-asmjs wasm2js does not support source maps yet |
ea8adc8c | 5 | |
ea8adc8c XL |
6 | #[cfg(target_os = "macos")] |
7 | #[test] | |
8 | fn simple_test() { | |
2c00a5a8 XL |
9 | use std::{env, panic, fs}; |
10 | ||
ea8adc8c XL |
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)); | |
16 | { | |
17 | let file = fs::OpenOptions::new().read(false).write(true).truncate(true).create(false) | |
18 | .open(&dsym_path).unwrap(); | |
19 | } | |
20 | ||
21 | env::set_var("RUST_BACKTRACE", "1"); | |
22 | ||
23 | // We don't need to die of panic, just trigger a backtrace | |
24 | let _ = panic::catch_unwind(|| { | |
25 | assert!(false); | |
26 | }); | |
27 | } |