mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-28 15:43:21 +00:00
compiletest: Fix bitrotted win32 routines
This commit is contained in:
parent
696a005181
commit
74ae36ccf2
@ -13,23 +13,25 @@ use std::str;
|
||||
use std::io::process::{ProcessExit, Process, ProcessConfig, ProcessOutput};
|
||||
|
||||
#[cfg(target_os = "win32")]
|
||||
fn target_env(lib_path: &str, prog: &str) -> Vec<(~str,~str)> {
|
||||
|
||||
let mut env = os::env();
|
||||
fn target_env(lib_path: &str, prog: &str) -> Vec<(~str, ~str)> {
|
||||
let env = os::env();
|
||||
|
||||
// Make sure we include the aux directory in the path
|
||||
assert!(prog.ends_with(".exe"));
|
||||
let aux_path = prog.slice(0u, prog.len() - 4u).to_owned() + ".libaux";
|
||||
|
||||
env = env.map(|pair| {
|
||||
let (k,v) = (*pair).clone();
|
||||
if k == ~"PATH" { (~"PATH", v + ";" + lib_path + ";" + aux_path) }
|
||||
else { (k,v) }
|
||||
});
|
||||
let mut new_env: Vec<_> = env.move_iter().map(|(k, v)| {
|
||||
let new_v = if "PATH" == k {
|
||||
format!("{};{};{}", v, lib_path, aux_path)
|
||||
} else {
|
||||
v
|
||||
};
|
||||
(k, new_v)
|
||||
}).collect();
|
||||
if prog.ends_with("rustc.exe") {
|
||||
env.push((~"RUST_THREADS", ~"1"));
|
||||
new_env.push((~"RUST_THREADS", ~"1"));
|
||||
}
|
||||
return env;
|
||||
return new_env;
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
|
@ -529,7 +529,7 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
|
||||
c
|
||||
}
|
||||
} ).collect();
|
||||
str::from_chars( c )
|
||||
str::from_chars(c.as_slice())
|
||||
}
|
||||
|
||||
#[cfg(target_os = "win32")]
|
||||
|
Loading…
Reference in New Issue
Block a user