Skip to content

Commit a502611

Browse files
committed
check ldd exit code
1 parent f3ca5a8 commit a502611

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

crates/fspy/tests/static_executable.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ fn test_bin_path() -> &'static Path {
2525
.expect("failed to set permissions on test binary");
2626

2727
// Verify that the test binary is indeed a static executable
28-
let output = std::process::Command::new("ldd")
29-
.arg(&test_bin_path)
30-
.output()
31-
.expect("failed to run ldd");
32-
let stderr = from_utf8(&output.stderr).unwrap().trim();
33-
assert_eq!(stderr, "not a dynamic executable");
28+
let output = std::process::Command::new("ldd").arg(&test_bin_path).output().unwrap();
29+
assert_eq!(
30+
output.status.code(),
31+
Some(1),
32+
"ldd should fail on static executables. Stdout: {}. Stderr: {}",
33+
from_utf8(&output.stdout).unwrap(),
34+
from_utf8(&output.stderr).unwrap()
35+
);
3436

3537
test_bin_path
3638
});

0 commit comments

Comments
 (0)