From 6dcc25c9a6fc9ed6ef0d2a18e0bbd7d9a96be509 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sun, 29 Mar 2020 14:46:27 -0700 Subject: [PATCH] Remove clippy tests. --- ci/azure-test-all.yml | 5 --- tests/testsuite/clippy.rs | 76 --------------------------------------- 2 files changed, 81 deletions(-) delete mode 100644 tests/testsuite/clippy.rs diff --git a/ci/azure-test-all.yml b/ci/azure-test-all.yml index 3bf4f183977..feb945ca215 100644 --- a/ci/azure-test-all.yml +++ b/ci/azure-test-all.yml @@ -11,11 +11,6 @@ steps: displayName: "Install gcc-multilib (linux)" condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) -# Some tests rely on a clippy command to run, so let's try to install clippy to -# we can be sure to run those tests. -- bash: rustup component add clippy || echo "clippy not available" - displayName: "Install clippy (maybe)" - # Some tests also rely on rustfmt - bash: rustup component add rustfmt || echo "rustfmt not available" displayName: "Install rustfmt (maybe)" diff --git a/tests/testsuite/clippy.rs b/tests/testsuite/clippy.rs deleted file mode 100644 index eeb449fb483..00000000000 --- a/tests/testsuite/clippy.rs +++ /dev/null @@ -1,76 +0,0 @@ -//! Tests for the `cargo clippy` command. - -use cargo_test_support::{command_is_available, project, registry::Package}; - -#[cargo_test] -// Clippy should never be considered fresh. -fn clippy_force_rebuild() { - if !command_is_available("clippy-driver") { - return; - } - - Package::new("dep1", "0.1.0").publish(); - - // This is just a random clippy lint (assertions_on_constants) that - // hopefully won't change much in the future. - let p = project() - .file( - "Cargo.toml", - r#" - [package] - name = "foo" - version = "0.1.0" - - [dependencies] - dep1 = "0.1" - "#, - ) - .file("src/lib.rs", "pub fn f() { assert!(true); }") - .build(); - - p.cargo("clippy-preview -Zunstable-options -v") - .masquerade_as_nightly_cargo() - .with_stderr_contains("[..]assert!(true)[..]") - .run(); - - // Make sure it runs again. - p.cargo("clippy-preview -Zunstable-options -v") - .masquerade_as_nightly_cargo() - .with_stderr_contains("[FRESH] dep1 v0.1.0") - .with_stderr_contains("[..]assert!(true)[..]") - .run(); -} - -#[cargo_test] -fn clippy_passes_args() { - if !command_is_available("clippy-driver") { - return; - } - - // This is just a random clippy lint (assertions_on_constants) that - // hopefully won't change much in the future. - let p = project() - .file( - "Cargo.toml", - r#" - [package] - name = "foo" - version = "0.1.0" - - [dependencies] - "#, - ) - .file("src/lib.rs", "pub fn f() { assert!(true); }") - .build(); - - p.cargo("clippy-preview -Zunstable-options -v -- -Aclippy::assertions_on_constants") - .masquerade_as_nightly_cargo() - .with_stderr_does_not_contain("[..]assert!(true)[..]") - .run(); - - // Make sure it runs again. - p.cargo("clippy-preview -Zunstable-options -v") - .masquerade_as_nightly_cargo() - .with_stderr_contains("[..]assert!(true)[..]") - .run(); -}