mirror of
https://github.com/serde-rs/serde.git
synced 2025-10-01 15:01:49 +00:00
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;
|
extern crate compiletest_rs as compiletest;
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::env;
|
||||||
use std::env::var;
|
|
||||||
|
|
||||||
fn run_mode(mode: &'static str) {
|
fn run_mode(mode: &'static str) {
|
||||||
let mut config = compiletest::default_config();
|
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());
|
config.target_rustcflags = Some("-L target/debug/ -L target/debug/deps/".to_owned());
|
||||||
if let Ok(name) = var::<&str>("TESTNAME") {
|
if let Ok(name) = env::var("TESTNAME") {
|
||||||
let s : String = name.to_owned();
|
config.filter = Some(name);
|
||||||
config.filter = Some(s)
|
|
||||||
}
|
}
|
||||||
config.mode = cfg_mode;
|
config.src_base = format!("tests/{}", mode).into();
|
||||||
config.src_base = PathBuf::from(format!("tests/{}", mode));
|
|
||||||
|
|
||||||
compiletest::run_tests(&config);
|
compiletest::run_tests(&config);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user