invalid stdout_utf8 handling in run_make_support

This commit is contained in:
Oneirical 2024-07-15 11:52:37 -04:00
parent 689bb118ce
commit dcaa17a661
2 changed files with 7 additions and 1 deletions

View File

@ -168,6 +168,12 @@ impl CompletedProcess {
String::from_utf8(self.output.stdout.clone()).expect("stdout is not valid UTF-8")
}
#[must_use]
#[track_caller]
pub fn invalid_stdout_utf8(&self) -> String {
String::from_utf8_lossy(&self.output.stdout.clone()).to_string()
}
#[must_use]
#[track_caller]
pub fn stderr_utf8(&self) -> String {

View File

@ -142,7 +142,7 @@ fn main() {
#[track_caller]
fn symbols_check(path: &str, symbol_check_type: SymbolCheckType, exists_once: bool) {
let out = llvm_readobj().arg("--dyn-symbols").input(path).run().stdout_utf8();
let out = llvm_readobj().arg("--dyn-symbols").input(path).run().invalid_stdout_utf8();
assert_eq!(
out.lines()
.filter(|&line| !line.contains("__imp_") && has_symbol(line, symbol_check_type))