-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add regression test for SIGPIPE on macOS * Disable `mmap` on macOS See rust-lang/rust#45866 for more details * Run `cargo fmt` * Remove unused variable name * s/macos/darwin/ * Move macOS test to its own file * Move macOS dSYM test to its own directory * Remove 'darwin' check to verify new test * Fix rustfmt * Re-add darwin check * Move macOS test to a non-workspace crate
- Loading branch information
Showing
6 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "macos_frames_test" | ||
version = "0.1.0" | ||
authors = ["Aaron Hill <[email protected]>"] | ||
edition = "2018" | ||
|
||
[dependencies.backtrace] | ||
path = "../.." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// intentionally blank |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Based on from https://github.com/rust-lang/rust/blob/2cb0b8582ebbf9784db9cec06fff517badbf4553/src/test/ui/issues/issue-45731.rs | ||
// This needs to go in a crate by itself, since it modifies the dSYM for the entire test | ||
// output directory. | ||
// | ||
// Note that this crate is *not* part of the overall `backtrace-rs` workspace, | ||
// so that it gets its own 'target' directory. We manually invoke this test | ||
// in .github/workflows/main.yml by passing `--manifest-path` to Cargo | ||
#[test] | ||
#[cfg(target_os = "macos")] | ||
fn backtrace_no_dsym() { | ||
use std::{env, fs, panic}; | ||
|
||
// 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 _ = fs::OpenOptions::new() | ||
.read(false) | ||
.write(true) | ||
.truncate(true) | ||
.create(false) | ||
.open(&dsym_path) | ||
.unwrap(); | ||
|
||
backtrace::Backtrace::new(); | ||
} |