1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
12 if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) {
15 let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
16 let clippy_cmd = std::path::Path::new(&root_dir)
18 .join(env!("PROFILE"))
19 .join("cargo-clippy");
21 let output = std::process::Command::new(clippy_cmd)
22 .current_dir(root_dir)
23 .env("CLIPPY_DOGFOOD", "1")
26 .arg("--all-features")
28 .args(&["-D", "clippy::all"])
29 .args(&["-D", "clippy::internal"])
30 .args(&["-D", "clippy::pedantic"])
33 println!("status: {}", output.status);
34 println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
35 println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
37 assert!(output.status.success());
42 if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) {
45 let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
46 let clippy_cmd = std::path::Path::new(&root_dir)
48 .join(env!("PROFILE"))
49 .join("cargo-clippy");
52 "clippy_workspace_tests",
53 "clippy_workspace_tests/src",
54 "clippy_workspace_tests/subcrate",
55 "clippy_workspace_tests/subcrate/src",
59 let output = std::process::Command::new(&clippy_cmd)
60 .current_dir(root_dir.join(d))
61 .env("CLIPPY_DOGFOOD", "1")
64 .args(&["-D", "clippy::all"])
65 .args(&["-D", "clippy::pedantic"])
68 println!("status: {}", output.status);
69 println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
70 println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
72 assert!(output.status.success());