@@ -51,7 +51,6 @@ pub fn simd_test(
5151 let target = env:: var ( "TARGET" ) . expect (
5252 "TARGET environment variable should be set for rustc (e.g. TARGET=x86_64-apple-darwin cargo test)"
5353 ) ;
54- let mut force_test = false ;
5554 let macro_test = match target
5655 . split ( '-' )
5756 . next ( )
@@ -63,27 +62,29 @@ pub fn simd_test(
6362 maybe_riscv if maybe_riscv. starts_with ( "riscv" ) => "is_riscv_feature_detected" ,
6463 "powerpc" | "powerpcle" => "is_powerpc_feature_detected" ,
6564 "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- }
8165 "loongarch64" => "is_loongarch_feature_detected" ,
8266 "s390x" => "is_s390x_feature_detected" ,
8367 t => panic ! ( "unknown target: {t}" ) ,
8468 } ;
8569 let macro_test = Ident :: new ( macro_test, Span :: call_site ( ) ) ;
8670
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+
8788 let mut detect_missing_features = TokenStream :: new ( ) ;
8889 for feature in target_features {
8990 let q = quote_spanned ! {
@@ -95,8 +96,7 @@ pub fn simd_test(
9596 q. to_tokens ( & mut detect_missing_features) ;
9697 }
9798
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 {
100100 quote ! { #[ ignore] }
101101 } else {
102102 TokenStream :: new ( )
@@ -111,7 +111,7 @@ pub fn simd_test(
111111 fn #name( ) {
112112 let mut missing_features = :: std:: vec:: Vec :: new( ) ;
113113 #detect_missing_features
114- if #force_test || missing_features. is_empty( ) {
114+ if missing_features. is_empty( ) {
115115 let v = unsafe { #name( ) } ;
116116 return v;
117117 } else {
0 commit comments