diff options
| author | Vincent Prouillet | 2016-12-27 14:31:17 +0900 |
|---|---|---|
| committer | Vincent Prouillet | 2016-12-28 11:49:43 +0900 |
| commit | c5c76fac8726d53988092d71c818d38f12e8348e (patch) | |
| tree | fffc8d3c5f369da2b935d118a2118d2fcca905a5 /validator_derive/tests/compile_test.rs | |
| download | validator-c5c76fac8726d53988092d71c818d38f12e8348e.tar.bz2 | |
Initial commit
Diffstat (limited to 'validator_derive/tests/compile_test.rs')
| -rw-r--r-- | validator_derive/tests/compile_test.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/validator_derive/tests/compile_test.rs b/validator_derive/tests/compile_test.rs new file mode 100644 index 0000000..b6fe8e5 --- /dev/null +++ b/validator_derive/tests/compile_test.rs @@ -0,0 +1,24 @@ +extern crate compiletest_rs as compiletest; + +use std::path::PathBuf; + +fn run_mode(mode: &'static str) { + let mut config = compiletest::default_config(); + let cfg_mode = mode.parse().expect("Invalid mode"); + + config.target_rustcflags = Some("-L target/debug/ -L target/debug/deps/".to_string()); + config.mode = cfg_mode; + config.src_base = PathBuf::from(format!("tests/{}", mode)); + + compiletest::run_tests(&config); +} + +#[test] +fn test_compile_fail() { + run_mode("compile-fail"); +} + +#[test] +fn test_run_pass() { + run_mode("run-pass"); +} |
