diff options
| author | bors <bors@rust-lang.org> | 2014-05-22 15:16:31 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-05-22 15:16:31 -0700 |
| commit | 87ad19eb78239707f1ceed43e475c6aa052efdbc (patch) | |
| tree | 35940d52f145bca81dcf73e5e7da7f3847ceb413 /src/compiletest | |
| parent | e402e75f4eb79af09b9451f0f232f994b3e2c998 (diff) | |
| parent | e878721d70349e2055f0ef854085de92e9498fde (diff) | |
| download | rust-87ad19eb78239707f1ceed43e475c6aa052efdbc.tar.gz rust-87ad19eb78239707f1ceed43e475c6aa052efdbc.zip | |
auto merge of #14310 : pcwalton/rust/detildestr-alllibs, r=brson
r? @brson
Diffstat (limited to 'src/compiletest')
| -rw-r--r-- | src/compiletest/compiletest.rs | 12 | ||||
| -rw-r--r-- | src/compiletest/errors.rs | 2 | ||||
| -rw-r--r-- | src/compiletest/header.rs | 9 | ||||
| -rw-r--r-- | src/compiletest/procsrv.rs | 3 | ||||
| -rw-r--r-- | src/compiletest/runtest.rs | 28 |
5 files changed, 37 insertions, 17 deletions
diff --git a/src/compiletest/compiletest.rs b/src/compiletest/compiletest.rs index db9cf358a9b..fa5d85111da 100644 --- a/src/compiletest/compiletest.rs +++ b/src/compiletest/compiletest.rs @@ -96,7 +96,7 @@ pub fn parse_config(args: Vec<StrBuf> ) -> Config { let args_ = args.tail(); if args.get(1).as_slice() == "-h" || args.get(1).as_slice() == "--help" { let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0); - println!("{}", getopts::usage(message, groups.as_slice())); + println!("{}", getopts::usage(message.as_slice(), groups.as_slice())); println!(""); fail!() } @@ -109,7 +109,7 @@ pub fn parse_config(args: Vec<StrBuf> ) -> Config { if matches.opt_present("h") || matches.opt_present("help") { let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0); - println!("{}", getopts::usage(message, groups.as_slice())); + println!("{}", getopts::usage(message.as_slice(), groups.as_slice())); println!(""); fail!() } @@ -323,11 +323,15 @@ pub fn is_test(config: &Config, testfile: &Path) -> bool { let mut valid = false; for ext in valid_extensions.iter() { - if name.ends_with(*ext) { valid = true; } + if name.ends_with(ext.as_slice()) { + valid = true; + } } for pre in invalid_prefixes.iter() { - if name.starts_with(*pre) { valid = false; } + if name.starts_with(pre.as_slice()) { + valid = false; + } } return valid; diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs index 408206b16e9..534e04ccb2d 100644 --- a/src/compiletest/errors.rs +++ b/src/compiletest/errors.rs @@ -24,7 +24,7 @@ pub fn load_errors(re: &Regex, testfile: &Path) -> Vec<ExpectedError> { let mut rdr = BufferedReader::new(File::open(testfile).unwrap()); rdr.lines().enumerate().filter_map(|(line_no, ln)| { - parse_expected(line_no + 1, ln.unwrap(), re) + parse_expected(line_no + 1, ln.unwrap().as_slice(), re) }).collect() } diff --git a/src/compiletest/header.rs b/src/compiletest/header.rs index 5729a11d7ad..55fca1784de 100644 --- a/src/compiletest/header.rs +++ b/src/compiletest/header.rs @@ -157,9 +157,14 @@ fn iter_header(testfile: &Path, it: |&str| -> bool) -> bool { // module or function. This doesn't seem to be an optimization // with a warm page cache. Maybe with a cold one. let ln = ln.unwrap(); - if ln.starts_with("fn") || ln.starts_with("mod") { + if ln.as_slice().starts_with("fn") || + ln.as_slice().starts_with("mod") { return true; - } else { if !(it(ln.trim())) { return false; } } + } else { + if !(it(ln.as_slice().trim())) { + return false; + } + } } return true; } diff --git a/src/compiletest/procsrv.rs b/src/compiletest/procsrv.rs index 6b273c2d463..2622cf0e5f1 100644 --- a/src/compiletest/procsrv.rs +++ b/src/compiletest/procsrv.rs @@ -15,7 +15,8 @@ use std::unstable::dynamic_lib::DynamicLibrary; fn target_env(lib_path: &str, prog: &str) -> Vec<(StrBuf, StrBuf)> { let prog = if cfg!(windows) {prog.slice_to(prog.len() - 4)} else {prog}; - let aux_path = prog + ".libaux"; + let mut aux_path = prog.to_strbuf(); + aux_path.push_str(".libaux"); // Need to be sure to put both the lib_path and the aux path in the dylib // search path for the child. diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 8c2b34ff35d..c591c477563 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -351,7 +351,10 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) { cmds, "quit".to_strbuf()].connect("\n"); debug!("script_str = {}", script_str); - dump_output_file(config, testfile, script_str, "debugger.script"); + dump_output_file(config, + testfile, + script_str.as_slice(), + "debugger.script"); procsrv::run("", @@ -459,7 +462,10 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) { "quit\n".to_strbuf() ].connect("\n"); debug!("script_str = {}", script_str); - dump_output_file(config, testfile, script_str, "debugger.script"); + dump_output_file(config, + testfile, + script_str.as_slice(), + "debugger.script"); // run debugger script with gdb #[cfg(windows)] @@ -538,7 +544,8 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path) // Set breakpoints on every line that contains the string "#break" for line in breakpoint_lines.iter() { - script_str.push_str(format!("breakpoint set --line {}\n", line)); + script_str.push_str(format!("breakpoint set --line {}\n", + line).as_slice()); } // Append the other commands @@ -552,7 +559,10 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path) // Write the script into a file debug!("script_str = {}", script_str); - dump_output_file(config, testfile, script_str.into_owned(), "debugger.script"); + dump_output_file(config, + testfile, + script_str.as_slice(), + "debugger.script"); let debugger_script = make_out_name(config, testfile, "debugger.script"); // Let LLDB execute the script via lldb_batchmode.py @@ -609,8 +619,8 @@ fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str) -> DebuggerCommands { use std::io::{BufferedReader, File}; - let command_directive = debugger_prefix + "-command"; - let check_directive = debugger_prefix + "-check"; + let command_directive = format!("{}-command", debugger_prefix); + let check_directive = format!("{}-check", debugger_prefix); let mut breakpoint_lines = vec!(); let mut commands = vec!(); @@ -620,18 +630,18 @@ fn parse_debugger_commands(file_path: &Path, debugger_prefix: &str) for line in reader.lines() { match line { Ok(line) => { - if line.contains("#break") { + if line.as_slice().contains("#break") { breakpoint_lines.push(counter); } header::parse_name_value_directive( - line, + line.as_slice(), command_directive.to_strbuf()).map(|cmd| { commands.push(cmd) }); header::parse_name_value_directive( - line, + line.as_slice(), check_directive.to_strbuf()).map(|cmd| { check_lines.push(cmd) }); |
