From 34dc07863da332e2a00b502d361205e5863592a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Fri, 6 Sep 2019 19:35:20 +0200 Subject: [PATCH 1/2] tests: execute dogfood tests with incremental compilation disabled reduces target/ dir size of when "cago test"ing by around 2 gigs. --- tests/dogfood.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/dogfood.rs b/tests/dogfood.rs index 1f03ba3950a..3cf39a8f9c1 100644 --- a/tests/dogfood.rs +++ b/tests/dogfood.rs @@ -12,6 +12,7 @@ fn dogfood() { let output = std::process::Command::new(clippy_cmd) .current_dir(root_dir) .env("CLIPPY_DOGFOOD", "1") + .env("CARGO_INCREMENTAL", "0") .arg("clippy-preview") .arg("--all-targets") .arg("--all-features") @@ -50,6 +51,7 @@ fn dogfood_tests() { let output = std::process::Command::new(&clippy_cmd) .current_dir(root_dir.join(d)) .env("CLIPPY_DOGFOOD", "1") + .env("CARGO_INCREMENTAL", "0") .arg("clippy") .arg("--") .args(&["-D", "clippy::all"]) From a1ecf394423eed9967e2c141c72a067da4b5eaaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 11 Sep 2019 20:52:36 +0200 Subject: [PATCH 2/2] tests: dogfood: run tests with debuginfo=0 reducing dogfood target dir size even further. --- tests/dogfood.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/dogfood.rs b/tests/dogfood.rs index 3cf39a8f9c1..944f3c2c013 100644 --- a/tests/dogfood.rs +++ b/tests/dogfood.rs @@ -1,15 +1,16 @@ #[test] -fn dogfood() { +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) { return; } let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let clippy_cmd = std::path::Path::new(&root_dir) + let clippy_binary = std::path::Path::new(&root_dir) .join("target") .join(env!("PROFILE")) .join("cargo-clippy"); - let output = std::process::Command::new(clippy_cmd) + let output = std::process::Command::new(clippy_binary) .current_dir(root_dir) .env("CLIPPY_DOGFOOD", "1") .env("CARGO_INCREMENTAL", "0") @@ -20,6 +21,7 @@ fn dogfood() { .args(&["-D", "clippy::all"]) .args(&["-D", "clippy::internal"]) .args(&["-D", "clippy::pedantic"]) + .arg("-Cdebuginfo=0") // disable debuginfo to generate less data in the target dir .output() .unwrap(); println!("status: {}", output.status); @@ -30,12 +32,13 @@ fn dogfood() { } #[test] -fn dogfood_tests() { +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) { return; } let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR")); - let clippy_cmd = std::path::Path::new(&root_dir) + let clippy_binary = std::path::Path::new(&root_dir) .join("target") .join(env!("PROFILE")) .join("cargo-clippy"); @@ -48,7 +51,7 @@ fn dogfood_tests() { "clippy_dev", "rustc_tools_util", ] { - let output = std::process::Command::new(&clippy_cmd) + let output = std::process::Command::new(&clippy_binary) .current_dir(root_dir.join(d)) .env("CLIPPY_DOGFOOD", "1") .env("CARGO_INCREMENTAL", "0") @@ -56,6 +59,7 @@ fn dogfood_tests() { .arg("--") .args(&["-D", "clippy::all"]) .args(&["-D", "clippy::pedantic"]) + .arg("-Cdebuginfo=0") // disable debuginfo to generate less data in the target dir .output() .unwrap(); println!("status: {}", output.status);