Run the debug CLI without Cargo loader paths
Some checks failed
Weekly OSV dependency audit / dependency-audit (push) Failing after 6s

- Add the Rust target library directory to the Linux debug CLI rpath
- Test that the built CLI runs without `LD_LIBRARY_PATH`
This commit is contained in:
Chili Palmer
2026-08-19 21:26:39 +02:00
parent 1b43014abd
commit 067e9a61e8
2 changed files with 47 additions and 0 deletions

View File

@@ -8,6 +8,23 @@ fn cli(home: &std::path::Path, args: &[&str]) -> std::process::Output {
.unwrap()
}
#[cfg(target_os = "linux")]
#[test]
fn built_cli_runs_without_cargo_loader_paths() {
let output = Command::new(env!("CARGO_BIN_EXE_bds-cli"))
.env_remove("LD_LIBRARY_PATH")
.arg("--help")
.output()
.unwrap();
assert!(
output.status.success(),
"{}",
String::from_utf8_lossy(&output.stderr)
);
assert!(String::from_utf8_lossy(&output.stdout).contains("rebuild"));
}
#[test]
fn process_exit_codes_help_and_shared_state_roundtrip() {
let root = tempfile::tempdir().unwrap();