X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=tests%2Fdogfood.rs;h=81af3d3033b23c268a152258d74a30a8cd0d4ecc;hb=e820a03d1c905d58b27d7ac6d85f450f9754ba79;hp=5458143ab1cc679fda4f076c3063f51bd9da79cf;hpb=75e983a5187bbce1ca54613620f432459a16e5d9;p=rust.git diff --git a/tests/dogfood.rs b/tests/dogfood.rs index 5458143ab1c..81af3d3033b 100644 --- a/tests/dogfood.rs +++ b/tests/dogfood.rs @@ -1,21 +1,20 @@ +// Dogfood cannot run on Windows +#![cfg(not(windows))] + use lazy_static::lazy_static; use std::path::PathBuf; use std::process::Command; -#[allow(dead_code)] mod cargo; lazy_static! { - static ref CLIPPY_PATH: PathBuf = { - let build_info = cargo::BuildInfo::new(); - build_info.target_lib().join("cargo-clippy") - }; + static ref CLIPPY_PATH: PathBuf = cargo::TARGET_LIB.join("cargo-clippy"); } #[test] fn dogfood_clippy() { // run clippy on itself and fail the test if lint warnings are reported - if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) { + if cargo::is_rustc_test_suite() { return; } let root_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); @@ -44,7 +43,7 @@ fn dogfood_clippy() { #[test] fn dogfood_subprojects() { // run clippy on remaining subprojects and fail the test if lint warnings are reported - if option_env!("RUSTC_TEST_SUITE").is_some() || cfg!(windows) { + if cargo::is_rustc_test_suite() { return; } let root_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));