1 #![feature(test, plugin)]
3 #![deny(clippy, clippy_pedantic)]
5 extern crate compiletest_rs as compiletest;
8 use std::env::{var, set_var};
9 use std::path::PathBuf;
14 // don't run dogfood on travis, cargo-clippy already runs clippy on itself
15 if let Ok(travis) = var("TRAVIS") {
21 let mut config = compiletest::default_config();
23 let cfg_mode = "run-fail".parse().expect("Invalid mode");
24 let mut s = String::new();
25 s.push_str(" -L target/debug/");
26 s.push_str(" -L target/debug/deps");
27 s.push_str(" -Zextra-plugins=clippy -Ltarget_recur/debug -Dwarnings -Dclippy_pedantic -Dclippy -Dclippy_internal");
28 config.target_rustcflags = Some(s);
29 if let Ok(name) = var("TESTNAME") {
30 config.filter = Some(name.to_owned())
33 config.mode = cfg_mode;
34 config.verbose = true;
36 let files = ["src/main.rs", "src/lib.rs", "clippy_lints/src/lib.rs"];
39 let paths = TestPaths {
41 file: PathBuf::from(file),
42 relative_dir: PathBuf::new(),
45 set_var("CLIPPY_DOGFOOD", "tastes like chicken");
47 compiletest::runtest::run(config.clone(), &paths);