Skip to content

Commit

Permalink
invalid stdout_utf8 handling in run_make_support
Browse files Browse the repository at this point in the history
  • Loading branch information
Oneirical committed Jul 15, 2024
1 parent 6848ab8 commit 5558cd1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/tools/run-make-support/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,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 {
Expand Down
2 changes: 1 addition & 1 deletion tests/run-make/symbol-visibility/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 5558cd1

Please sign in to comment.