Skip to content

Commit dcaa17a

Browse files
committed
invalid stdout_utf8 handling in run_make_support
1 parent 689bb11 commit dcaa17a

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/tools/run-make-support/src/command.rs

+6
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ impl CompletedProcess {
168168
String::from_utf8(self.output.stdout.clone()).expect("stdout is not valid UTF-8")
169169
}
170170

171+
#[must_use]
172+
#[track_caller]
173+
pub fn invalid_stdout_utf8(&self) -> String {
174+
String::from_utf8_lossy(&self.output.stdout.clone()).to_string()
175+
}
176+
171177
#[must_use]
172178
#[track_caller]
173179
pub fn stderr_utf8(&self) -> String {

tests/run-make/symbol-visibility/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ fn main() {
142142

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

0 commit comments

Comments
 (0)