@@ -51,7 +51,6 @@ pub fn simd_test(
51
51
let target = env:: var ( "TARGET" ) . expect (
52
52
"TARGET environment variable should be set for rustc (e.g. TARGET=x86_64-apple-darwin cargo test)"
53
53
) ;
54
- let mut force_test = false ;
55
54
let macro_test = match target
56
55
. split ( '-' )
57
56
. next ( )
@@ -63,27 +62,29 @@ pub fn simd_test(
63
62
maybe_riscv if maybe_riscv. starts_with ( "riscv" ) => "is_riscv_feature_detected" ,
64
63
"powerpc" | "powerpcle" => "is_powerpc_feature_detected" ,
65
64
"powerpc64" | "powerpc64le" => "is_powerpc64_feature_detected" ,
66
- "mips" | "mipsel" | "mipsisa32r6" | "mipsisa32r6el" => {
67
- // FIXME:
68
- // On MIPS CI run-time feature detection always returns false due
69
- // to this qemu bug: https://bugs.launchpad.net/qemu/+bug/1754372
70
- //
71
- // This is a workaround to force the MIPS tests to always run on
72
- // CI.
73
- force_test = true ;
74
- "is_mips_feature_detected"
75
- }
76
- "mips64" | "mips64el" | "mipsisa64r6" | "mipsisa64r6el" => {
77
- // FIXME: see above
78
- force_test = true ;
79
- "is_mips64_feature_detected"
80
- }
81
65
"loongarch64" => "is_loongarch_feature_detected" ,
82
66
"s390x" => "is_s390x_feature_detected" ,
83
67
t => panic ! ( "unknown target: {t}" ) ,
84
68
} ;
85
69
let macro_test = Ident :: new ( macro_test, Span :: call_site ( ) ) ;
86
70
71
+ let skipped_functions = env:: var ( "STDARCH_TEST_SKIP_FUNCTION" ) . unwrap_or_default ( ) ;
72
+ let skipped_features = env:: var ( "STDARCH_TEST_SKIP_FEATURE" ) . unwrap_or_default ( ) ;
73
+
74
+ let mut name_str = & * name. to_string ( ) ;
75
+ if name_str. starts_with ( "test_" ) {
76
+ name_str = & name_str[ 5 ..] ;
77
+ }
78
+
79
+ let skip_this = skipped_functions
80
+ . split ( ',' )
81
+ . map ( str:: trim)
82
+ . any ( |s| s == name_str)
83
+ && skipped_features
84
+ . split ( ',' )
85
+ . map ( str:: trim)
86
+ . any ( |s| target_features. iter ( ) . any ( |feature| s == feature) ) ;
87
+
87
88
let mut detect_missing_features = TokenStream :: new ( ) ;
88
89
for feature in target_features {
89
90
let q = quote_spanned ! {
@@ -95,8 +96,7 @@ pub fn simd_test(
95
96
q. to_tokens ( & mut detect_missing_features) ;
96
97
}
97
98
98
- let test_norun = std:: env:: var ( "STDSIMD_TEST_NORUN" ) . is_ok ( ) ;
99
- let maybe_ignore = if test_norun {
99
+ let maybe_ignore = if skip_this {
100
100
quote ! { #[ ignore] }
101
101
} else {
102
102
TokenStream :: new ( )
@@ -111,7 +111,7 @@ pub fn simd_test(
111
111
fn #name( ) {
112
112
let mut missing_features = :: std:: vec:: Vec :: new( ) ;
113
113
#detect_missing_features
114
- if #force_test || missing_features. is_empty( ) {
114
+ if missing_features. is_empty( ) {
115
115
let v = unsafe { #name( ) } ;
116
116
return v;
117
117
} else {
0 commit comments