about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-04-08 01:19:38 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-04-08 01:19:38 +0530
commitc4bd1c2bb293c4ccb29fcc8fbceff78f6c5756d1 (patch)
tree491b7774e6f49e811af4fd444de5e76539b6e435 /src
parentfe2cff74f4f885e914c03a72bf2d69c209aad6e7 (diff)
parentfc2494b80c565bb48ac486a36814829cd969e56d (diff)
downloadrust-c4bd1c2bb293c4ccb29fcc8fbceff78f6c5756d1.tar.gz
rust-c4bd1c2bb293c4ccb29fcc8fbceff78f6c5756d1.zip
Rollup merge of #24150 - wg:master, r=alexcrichton
This fix allows the gdb debuginfo tests to pass on FreeBSD when using the newer 7.8 package.
Diffstat (limited to 'src')
-rw-r--r--src/compiletest/runtest.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs
index d99f06bd853..f387f83ad52 100644
--- a/src/compiletest/runtest.rs
+++ b/src/compiletest/runtest.rs
@@ -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 \
@@ -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 {
@@ -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"
+    }
+}