make sure compiletest works on windows

This commit is contained in:
Oliver Schneider 2016-05-13 13:46:13 +02:00
parent c37300d899
commit d4e11acc1f
2 changed files with 11 additions and 2 deletions

View File

@ -1,7 +1,7 @@
extern crate compiletest_rs as compiletest;
use std::path::PathBuf;
use std::env::var;
use std::env::{var, temp_dir};
fn run_mode(dir: &'static str, mode: &'static str) {
let mut config = compiletest::default_config();
@ -14,6 +14,10 @@ fn run_mode(dir: &'static str, mode: &'static str) {
}
config.mode = cfg_mode;
if cfg!(windows) {
// work around https://github.com/laumann/compiletest-rs/issues/35 on msvc windows
config.build_base = temp_dir();
}
config.src_base = PathBuf::from(format!("tests/{}", dir));
compiletest::run_tests(&config);

View File

@ -5,7 +5,7 @@
extern crate compiletest_rs as compiletest;
extern crate test;
use std::env::{var, set_var};
use std::env::{var, set_var, temp_dir};
use std::path::PathBuf;
use test::TestPaths;
@ -23,6 +23,11 @@ fn dogfood() {
config.filter = Some(name.to_owned())
}
if cfg!(windows) {
// work around https://github.com/laumann/compiletest-rs/issues/35 on msvc windows
config.build_base = temp_dir();
}
config.mode = cfg_mode;
let paths = TestPaths {