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::Config::default();
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");
28 " -Zextra-plugins=clippy -Ltarget_recur/debug -Dwarnings -Dclippy_pedantic -Dclippy -Dclippy_internal",
30 config.target_rustcflags = Some(s);
31 if let Ok(name) = var("TESTNAME") {
32 config.filter = Some(name.to_owned())
35 config.mode = cfg_mode;
36 config.verbose = true;
38 let files = ["src/main.rs", "src/lib.rs", "clippy_lints/src/lib.rs"];
41 let paths = TestPaths {
43 file: PathBuf::from(file),
44 relative_dir: PathBuf::new(),
47 set_var("CLIPPY_DOGFOOD", "tastes like chicken");
49 compiletest::runtest::run(config.clone(), &paths);