Clean up the compile_tests script
This commit is contained in:
parent
571a2e4e2d
commit
91f628727b
@ -1,20 +1,16 @@
|
||||
extern crate compiletest_rs as compiletest;
|
||||
|
||||
use std::path::PathBuf;
|
||||
use std::env::var;
|
||||
use std::env;
|
||||
|
||||
fn run_mode(mode: &'static str) {
|
||||
let mut config = compiletest::default_config();
|
||||
|
||||
let cfg_mode = mode.parse().expect("Invalid mode");
|
||||
|
||||
config.mode = mode.parse().expect("invalid mode");
|
||||
config.target_rustcflags = Some("-L target/debug/ -L target/debug/deps/".to_owned());
|
||||
if let Ok(name) = var::<&str>("TESTNAME") {
|
||||
let s : String = name.to_owned();
|
||||
config.filter = Some(s)
|
||||
if let Ok(name) = env::var("TESTNAME") {
|
||||
config.filter = Some(name);
|
||||
}
|
||||
config.mode = cfg_mode;
|
||||
config.src_base = PathBuf::from(format!("tests/{}", mode));
|
||||
config.src_base = format!("tests/{}", mode).into();
|
||||
|
||||
compiletest::run_tests(&config);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user