Skip to content

Commit fc2494b

Browse files
committed
Fix charset of debuginfo test on FreeBSD
1 parent c52d46e commit fc2494b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Diff for: src/compiletest/runtest.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
382382

383383
// write debugger script
384384
let mut script_str = String::with_capacity(2048);
385-
let charset = if cfg!(target_os = "bitrig") { "auto" } else { "UTF-8" };
386-
script_str.push_str(&format!("set charset {}\n", charset));
385+
script_str.push_str(&format!("set charset {}\n", charset()));
387386
script_str.push_str(&format!("file {}\n", exe_file.to_str().unwrap()));
388387
script_str.push_str("target remote :5039\n");
389388
script_str.push_str(&format!("set solib-search-path \
@@ -517,8 +516,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
517516
.to_string();
518517
// write debugger script
519518
let mut script_str = String::with_capacity(2048);
520-
let charset = if cfg!(target_os = "bitrig") { "auto" } else { "UTF-8" };
521-
script_str.push_str(&format!("set charset {}\n", charset));
519+
script_str.push_str(&format!("set charset {}\n", charset()));
522520
script_str.push_str("show version\n");
523521

524522
match config.gdb_version {
@@ -1791,3 +1789,11 @@ fn run_codegen_test(config: &Config, props: &TestProps,
17911789
(base_lines as f64) / (clang_lines as f64),
17921790
0.001);
17931791
}
1792+
1793+
fn charset() -> &'static str {
1794+
if cfg!(any(target_os = "bitrig", target_os = "freebsd")) {
1795+
"auto"
1796+
} else {
1797+
"UTF-8"
1798+
}
1799+
}

0 commit comments

Comments
 (0)