From e71680a1fd0c688bc204e62ce11861a237056cf5 Mon Sep 17 00:00:00 2001 From: Ryan Mehri Date: Thu, 9 Jan 2025 21:51:43 -0800 Subject: [PATCH] skip style checker implementation tests in ci as well --- ci/style.sh | 2 +- libc-test/test/check_style.rs | 2 +- libc-test/test/style_tests.rs | 34 +++++++++++++++++----------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ci/style.sh b/ci/style.sh index da16bf4fe9ba..bd1432e50bd9 100755 --- a/ci/style.sh +++ b/ci/style.sh @@ -9,7 +9,7 @@ if [ -n "${CI:-}" ]; then check="--check" fi -cargo test --manifest-path libc-test/Cargo.toml --test style -- --nocapture +cargo test --manifest-path libc-test/Cargo.toml --test style --test style_tests -- --nocapture command -v rustfmt rustfmt -V diff --git a/libc-test/test/check_style.rs b/libc-test/test/check_style.rs index ae5d776dd948..ee5e13489110 100644 --- a/libc-test/test/check_style.rs +++ b/libc-test/test/check_style.rs @@ -1,4 +1,4 @@ -//! Simple script to verify the coding style of this library +//! Simple script to verify the coding style of this library. //! //! ## How to run //! diff --git a/libc-test/test/style_tests.rs b/libc-test/test/style_tests.rs index e42f1d704aa6..be8fddbccf64 100644 --- a/libc-test/test/style_tests.rs +++ b/libc-test/test/style_tests.rs @@ -1,11 +1,11 @@ -//! Verifies the implementation of the style checker in [style] +//! Verifies the implementation of the style checker in [style]. use style::StyleChecker; pub mod style; #[test] -fn accept_correct_module_layout() { +fn check_style_accept_correct_module_layout() { let contents = r#" use core::mem::size_of; pub type foo_t = u32; @@ -24,7 +24,7 @@ pub use self::foolib::*; } #[test] -fn reject_incorrect_module_layout() { +fn check_style_reject_incorrect_module_layout() { let contents = r#" use core::mem::size_of; pub type foo_t = u32; @@ -43,7 +43,7 @@ pub use self::foolib::*; } #[test] -fn reject_incorrect_cfg_if_layout() { +fn check_style_reject_incorrect_cfg_if_layout() { let contents = r#" cfg_if! { if #[cfg(foo)] { @@ -60,7 +60,7 @@ cfg_if! { } #[test] -fn accept_cfg_if_branch_resets_state() { +fn check_style_accept_cfg_if_branch_resets_state() { let contents = r#" cfg_if! { if #[cfg(foo)] { @@ -79,7 +79,7 @@ cfg_if! { } #[test] -fn reject_multiple_f_macros() { +fn check_style_reject_multiple_f_macros() { let contents = r#" f! {} f! {} @@ -92,7 +92,7 @@ f! {} } #[test] -fn cfg_ignore_target_endian_nested() { +fn check_style_accept_cfg_ignore_target_endian_nested() { let contents = r#" pub struct Foo { #[cfg(target_endian = "little")] @@ -107,7 +107,7 @@ pub struct Foo { } #[test] -fn reject_manual_copy() { +fn check_style_reject_manual_copy() { let contents = r#" #[derive(Copy)] pub struct Foo {} @@ -120,7 +120,7 @@ pub struct Foo {} } #[test] -fn reject_manual_clone() { +fn check_style_reject_manual_clone() { let contents = r#" #[derive(Clone)] pub struct Foo {} @@ -133,7 +133,7 @@ pub struct Foo {} } #[test] -fn accept_multiple_s_macros_with_disjoint_cfg() { +fn check_style_accept_multiple_s_macros_with_disjoint_cfg() { let contents = r#" // Main `s!` s! {} @@ -155,7 +155,7 @@ s! { pub struct bar { /* ... */ } } } #[test] -fn reject_duplicated_s_macro() { +fn check_style_reject_duplicated_s_macro() { let contents = r#" s! {} s! {} @@ -168,7 +168,7 @@ s! {} } #[test] -fn reject_duplicated_s_macro_cfg() { +fn check_style_reject_duplicated_s_macro_cfg() { let contents = r#" #[cfg(not(target_arch = "foo"))] s! {} @@ -184,7 +184,7 @@ s! {} } #[test] -fn reject_single_positive_s_macro_cfg() { +fn check_style_reject_single_positive_s_macro_cfg() { let contents = r#" // A positive (no `not`) config: reject because this should go into // the relevant file. @@ -199,7 +199,7 @@ s! { pub struct foo { /* ... */ } } } #[test] -fn reject_single_positive_s_macro_cfg_target_os() { +fn check_style_reject_single_positive_s_macro_cfg_target_os() { let contents = r#" // A positive (no `not`) config: reject because this should go into // the relevant file. @@ -214,7 +214,7 @@ s! { pub struct foo { /* ... */ } } } #[test] -fn accept_positive_s_macro_any() { +fn check_style_accept_positive_s_macro_any() { let contents = r#" // It's nicer to accept this so that we don't have to duplicate the same struct 3 times. #[cfg(any(target_arch = "foo", target_arch = "bar", target_arch = "baz"))] @@ -228,7 +228,7 @@ s! { pub struct foo { /* ... */ } } } #[test] -fn accept_positive_s_macro_all() { +fn check_style_accept_positive_s_macro_all() { let contents = r#" #[cfg(all(target_arch = "foo", target_arch = "bar", target_arch = "baz"))] s! { pub struct foo { /* ... */ } } @@ -241,7 +241,7 @@ s! { pub struct foo { /* ... */ } } } #[test] -fn reject_duplicated_cfg_and_cfg_if() { +fn check_style_reject_duplicated_cfg_and_cfg_if() { let contents = r#" #[cfg(not(target_arch = "foo"))] s! { pub struct foo { /* ... */ } }