Skip to content

Commit 6a0b39d

Browse files
committed
fix test to ignore itself when it cannot invoke readelf.
1 parent 12f4fbc commit 6a0b39d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/current-exe-mismatch.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ fn find_interpreter(me: &Path) -> Result<PathBuf, EarlyExit> {
112112
.arg("-l")
113113
.arg(me)
114114
.output()
115-
.unwrap();
115+
.map_err(|_err| {
116+
EarlyExit::IgnoreTest("readelf invocation failed".into())
117+
})?;
116118
if result.status.success() {
117119
let r = BufReader::new(&result.stdout[..]);
118120
for line in r.lines() {
@@ -128,6 +130,6 @@ fn find_interpreter(me: &Path) -> Result<PathBuf, EarlyExit> {
128130

129131
Err(EarlyExit::IgnoreTest("could not find interpreter from readelf output".into()))
130132
} else {
131-
Err(EarlyExit::IgnoreTest("readelf invocation failed".into()))
133+
Err(EarlyExit::IgnoreTest("readelf returned non-success".into()))
132134
}
133135
}

0 commit comments

Comments
 (0)