diff options
| author | Niv Kaminer <nivkner@zoho.com> | 2018-12-17 23:45:26 +0200 |
|---|---|---|
| committer | Niv Kaminer <nivkner@zoho.com> | 2018-12-19 21:23:05 +0200 |
| commit | 0e72c80afe9024ea7824579cd12c428264bb4783 (patch) | |
| tree | bb808e4c9b878b0fecfcbec6dd8c53d76b26d1ad /src | |
| parent | 957a9c7c666801019478f1ff1535d8395127fa6f (diff) | |
| download | rust-0e72c80afe9024ea7824579cd12c428264bb4783.tar.gz rust-0e72c80afe9024ea7824579cd12c428264bb4783.zip | |
FIXME(9639) remove fixme and accept non-utf8 paths in compiletest
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 45527a7cce5..8c6e97893fb 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -27,7 +27,7 @@ use util::{logv, PathBufExt}; use std::collections::hash_map::DefaultHasher; use std::collections::{HashMap, HashSet, VecDeque}; use std::env; -use std::ffi::OsString; +use std::ffi::{OsStr, OsString}; use std::fmt; use std::fs::{self, create_dir_all, File}; use std::hash::{Hash, Hasher}; @@ -760,13 +760,13 @@ impl<'test> TestCx<'test> { } drop(stdout); - let debugger_script = self.make_out_name("debugger.script"); - // FIXME (#9639): This needs to handle non-utf8 paths - let debugger_opts = vec![ - "-quiet".to_owned(), - "-batch".to_owned(), - "-nx".to_owned(), - format!("-command={}", debugger_script.to_str().unwrap()), + let mut debugger_script = OsString::from("-command="); + debugger_script.push(self.make_out_name("debugger.script")); + let debugger_opts: &[&OsStr] = &[ + "-quiet".as_ref(), + "-batch".as_ref(), + "-nx".as_ref(), + &debugger_script, ]; let gdb_path = self.config.gdb.as_ref().unwrap(); @@ -775,12 +775,12 @@ impl<'test> TestCx<'test> { stdout, stderr, } = Command::new(&gdb_path) - .args(&debugger_opts) + .args(debugger_opts) .output() .expect(&format!("failed to exec `{:?}`", gdb_path)); let cmdline = { let mut gdb = Command::new(&format!("{}-gdb", self.config.target)); - gdb.args(&debugger_opts); + gdb.args(debugger_opts); let cmdline = self.make_cmdline(&gdb, ""); logv(self.config, format!("executing {}", cmdline)); cmdline @@ -868,18 +868,18 @@ impl<'test> TestCx<'test> { debug!("script_str = {}", script_str); self.dump_output_file(&script_str, "debugger.script"); - let debugger_script = self.make_out_name("debugger.script"); + let mut debugger_script = OsString::from("-command="); + debugger_script.push(self.make_out_name("debugger.script")); - // FIXME (#9639): This needs to handle non-utf8 paths - let debugger_opts = vec![ - "-quiet".to_owned(), - "-batch".to_owned(), - "-nx".to_owned(), - format!("-command={}", debugger_script.to_str().unwrap()), + let debugger_opts: &[&OsStr] = &[ + "-quiet".as_ref(), + "-batch".as_ref(), + "-nx".as_ref(), + &debugger_script, ]; let mut gdb = Command::new(self.config.gdb.as_ref().unwrap()); - gdb.args(&debugger_opts) + gdb.args(debugger_opts) .env("PYTHONPATH", rust_pp_module_abs_path); debugger_run_result = self.compose_and_run( |
