Skip to content

Commit 323709c

Browse files
committed
add integration tests for inlinee info
1 parent 7c156fa commit 323709c

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

minidump-processor/src/process_state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,15 +455,15 @@ impl CallStack {
455455
}
456456

457457
// Function name
458-
writeln!(f, "!{}", inline.function_name)?;
458+
write!(f, "!{}", inline.function_name)?;
459459

460460
// Source file and line
461461
if let (&Some(ref source_file), &Some(ref source_line)) =
462462
(&inline.source_file_name, &inline.source_line)
463463
{
464464
write!(f, " [{} : {}]", basename(source_file), source_line,)?;
465465
}
466-
466+
writeln!(f)?;
467467
// A fake `trust`
468468
writeln!(f, " Found by: inlining")?;
469469
}

minidump-stackwalk/tests/test-minidump-stackwalk.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,3 +798,45 @@ fn test_unloaded() {
798798
insta::assert_snapshot!("json-pretty-unloaded", json_out);
799799
assert_eq!(stderr, "");
800800
}
801+
802+
#[test]
803+
fn test_macos_inlines_json_pretty() {
804+
// For a while this didn't parse right
805+
let bin = env!("CARGO_BIN_EXE_minidump-stackwalk");
806+
let output = Command::new(bin)
807+
.arg("--json")
808+
.arg("--pretty")
809+
.arg("--symbols-path=../testdata/symbols/")
810+
.arg("../testdata/pipeline-inlines-macos-segv.dmp")
811+
.stdout(Stdio::piped())
812+
.stderr(Stdio::piped())
813+
.output()
814+
.unwrap();
815+
816+
let stdout = String::from_utf8(output.stdout).unwrap();
817+
let stderr = String::from_utf8(output.stderr).unwrap();
818+
819+
assert!(output.status.success());
820+
insta::assert_snapshot!(stdout);
821+
assert_eq!(stderr, "");
822+
}
823+
824+
#[test]
825+
fn test_macos_inlines_human() {
826+
let bin = env!("CARGO_BIN_EXE_minidump-stackwalk");
827+
let output = Command::new(bin)
828+
.arg("--human")
829+
.arg("--symbols-path=../testdata/symbols/")
830+
.arg("../testdata/pipeline-inlines-macos-segv.dmp")
831+
.stdout(Stdio::piped())
832+
.stderr(Stdio::piped())
833+
.output()
834+
.unwrap();
835+
836+
let stdout = String::from_utf8(output.stdout).unwrap();
837+
let stderr = String::from_utf8(output.stderr).unwrap();
838+
839+
assert!(output.status.success());
840+
insta::assert_snapshot!(stdout);
841+
assert_eq!(stderr, "");
842+
}

0 commit comments

Comments
 (0)