1 #![feature(test, plugin)]
3 #![deny(clippy, clippy_pedantic)]
5 extern crate compiletest_rs as compiletest;
8 use std::env::{var, set_var, temp_dir};
9 use std::path::PathBuf;
14 let mut config = compiletest::default_config();
16 let cfg_mode = "run-fail".parse().expect("Invalid mode");
17 let mut s = String::new();
18 s.push_str(" -L target/debug/");
19 s.push_str(" -L target/debug/deps");
20 s.push_str(" -Zextra-plugins=clippy -Ltarget_recur/debug -Dclippy_pedantic -Dclippy");
21 config.target_rustcflags = Some(s);
22 if let Ok(name) = var("TESTNAME") {
23 config.filter = Some(name.to_owned())
27 // work around https://github.com/laumann/compiletest-rs/issues/35 on msvc windows
28 config.build_base = temp_dir();
31 config.mode = cfg_mode;
33 let files = ["src/main.rs", "src/lib.rs", "clippy_lints/src/lib.rs"];
36 let paths = TestPaths {
38 file: PathBuf::from(file),
39 relative_dir: PathBuf::new(),
42 set_var("CLIPPY_DOGFOOD", "tastes like chicken");
44 compiletest::runtest::run(config.clone(), &paths);