serde/test_suite/tests/compiletest.rs

27 lines
576 B
Rust
Raw Normal View History

extern crate compiletest_rs as compiletest;
2017-01-27 14:37:28 -08:00
use std::env;
fn run_mode(mode: &'static str) {
let mut config = compiletest::default_config();
2017-01-27 14:37:28 -08:00
config.mode = mode.parse().expect("invalid mode");
2017-01-27 14:53:21 -08:00
config.target_rustcflags = Some("-L deps/target/debug/deps".to_owned());
2017-01-27 14:37:28 -08:00
if let Ok(name) = env::var("TESTNAME") {
config.filter = Some(name);
}
2017-01-27 14:37:28 -08:00
config.src_base = format!("tests/{}", mode).into();
compiletest::run_tests(&config);
}
#[test]
2016-07-04 14:49:50 -07:00
fn compile_fail() {
run_mode("compile-fail");
}
2016-07-04 14:49:50 -07:00
#[test]
fn run_pass() {
run_mode("run-pass");
}