// Copyright (C) 2016 Symtern Project Contributors // // Licensed under the Apache License, Version 2.0 or the MIT // license , // at your option. This file may not be copied, modified, or // distributed except according to those terms. extern crate compiletest_rs as compiletest; extern crate symtern; use std::path::PathBuf; fn run_mode

(mode: &'static str, path: P) where P: Into> { let mut config = compiletest::default_config(); let cfg_mode = mode.parse().expect("Invalid mode"); config.mode = cfg_mode; config.src_base = PathBuf::from(format!("tests/{}", path.into().unwrap_or(mode))); config.target_rustcflags = Some("-L target/debug -L target/debug/deps".to_string()); compiletest::run_tests(&config); } #[test] fn compile_test() { run_mode("compile-fail", None); run_mode("run-fail", None); run_mode("run-pass", "../examples"); }