2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2018-09-27 19:00:21 +00:00
|
|
|
#![allow(unused_variables)]
|
2017-11-08 10:28:17 +00:00
|
|
|
// compile-flags:--test -g
|
2019-08-17 05:08:01 +00:00
|
|
|
// ignore-asmjs wasm2js does not support source maps yet
|
2017-11-08 10:28:17 +00:00
|
|
|
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
#[test]
|
|
|
|
fn simple_test() {
|
2018-01-02 13:11:41 +00:00
|
|
|
use std::{env, panic, fs};
|
|
|
|
|
2017-11-08 10:28:17 +00:00
|
|
|
// Find our dSYM and replace the DWARF binary with an empty file
|
|
|
|
let mut dsym_path = env::current_exe().unwrap();
|
|
|
|
let executable_name = dsym_path.file_name().unwrap().to_str().unwrap().to_string();
|
|
|
|
assert!(dsym_path.pop()); // Pop executable
|
|
|
|
dsym_path.push(format!("{}.dSYM/Contents/Resources/DWARF/{0}", executable_name));
|
|
|
|
{
|
|
|
|
let file = fs::OpenOptions::new().read(false).write(true).truncate(true).create(false)
|
|
|
|
.open(&dsym_path).unwrap();
|
|
|
|
}
|
|
|
|
|
|
|
|
env::set_var("RUST_BACKTRACE", "1");
|
|
|
|
|
|
|
|
// We don't need to die of panic, just trigger a backtrace
|
|
|
|
let _ = panic::catch_unwind(|| {
|
|
|
|
assert!(false);
|
|
|
|
});
|
|
|
|
}
|