mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
high-speed-dogfood
This commit is contained in:
parent
617c820e6b
commit
3d1b7e1957
2 changed files with 28 additions and 0 deletions
|
@ -3,6 +3,10 @@
|
||||||
#![feature(num_bits_bytes, iter_arith)]
|
#![feature(num_bits_bytes, iter_arith)]
|
||||||
#![allow(unknown_lints)]
|
#![allow(unknown_lints)]
|
||||||
|
|
||||||
|
// this only exists to allow the "dogfood" integration test to work
|
||||||
|
#[allow(dead_code)]
|
||||||
|
fn main() { println!("What are you doing? Don't run clippy as an executable"); }
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
24
tests/dogfood.rs
Normal file
24
tests/dogfood.rs
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
extern crate compiletest_rs as compiletest;
|
||||||
|
|
||||||
|
use std::path::Path;
|
||||||
|
use std::env::var;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn dogfood() {
|
||||||
|
let mut config = compiletest::default_config();
|
||||||
|
|
||||||
|
let cfg_mode = "run-pass".parse().ok().expect("Invalid mode");
|
||||||
|
let mut s = String::new();
|
||||||
|
s.push_str(" -L target/debug/");
|
||||||
|
s.push_str(" -L target/debug/deps");
|
||||||
|
s.push_str(" -Zextra-plugins=clippy -Ltarget_recur/debug -Dclippy_pedantic -Dclippy");
|
||||||
|
config.target_rustcflags = Some(s);
|
||||||
|
if let Ok(name) = var::<&str>("TESTNAME") {
|
||||||
|
let s : String = name.to_owned();
|
||||||
|
config.filter = Some(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
config.mode = cfg_mode;
|
||||||
|
|
||||||
|
compiletest::runtest::run(config, &Path::new("src/lib.rs"));
|
||||||
|
}
|
Loading…
Reference in a new issue