Skip to content

Fix charset of debuginfo test on FreeBSD #24150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {

// write debugger script
let mut script_str = String::with_capacity(2048);
let charset = if cfg!(target_os = "bitrig") { "auto" } else { "UTF-8" };
script_str.push_str(&format!("set charset {}\n", charset));
script_str.push_str(&format!("set charset {}\n", charset()));
script_str.push_str(&format!("file {}\n", exe_file.to_str().unwrap()));
script_str.push_str("target remote :5039\n");
script_str.push_str(&format!("set solib-search-path \
Expand Down Expand Up @@ -517,8 +516,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
.to_string();
// write debugger script
let mut script_str = String::with_capacity(2048);
let charset = if cfg!(target_os = "bitrig") { "auto" } else { "UTF-8" };
script_str.push_str(&format!("set charset {}\n", charset));
script_str.push_str(&format!("set charset {}\n", charset()));
script_str.push_str("show version\n");

match config.gdb_version {
Expand Down Expand Up @@ -1791,3 +1789,11 @@ fn run_codegen_test(config: &Config, props: &TestProps,
(base_lines as f64) / (clang_lines as f64),
0.001);
}

fn charset() -> &'static str {
if cfg!(any(target_os = "bitrig", target_os = "freebsd")) {
"auto"
} else {
"UTF-8"
}
}