@@ -926,7 +926,7 @@ pub fn make_test_description<R: Read>(
926926 cfg : Option < & str > ,
927927) -> test:: TestDesc {
928928 let mut ignore = false ;
929- let ignore_message = None ;
929+ let mut ignore_message = None ;
930930 let mut should_fail = false ;
931931
932932 let rustc_has_profiler_support = env:: var_os ( "RUSTC_PROFILER_SUPPORT" ) . is_some ( ) ;
@@ -966,41 +966,67 @@ pub fn make_test_description<R: Read>(
966966 if revision. is_some ( ) && revision != cfg {
967967 return ;
968968 }
969+ macro_rules! reason {
970+ ( $e: expr) => {
971+ ignore |= match $e {
972+ true => {
973+ ignore_message = Some ( stringify!( $e) ) ;
974+ true
975+ }
976+ false => ignore,
977+ }
978+ } ;
979+ }
969980 ignore = match config. parse_cfg_name_directive ( ln, "ignore" ) {
970- ParsedNameDirective :: Match => true ,
981+ ParsedNameDirective :: Match => {
982+ ignore_message = Some ( "cfg -> ignore => Match" ) ;
983+ true
984+ }
971985 ParsedNameDirective :: NoMatch => ignore,
972986 } ;
987+
973988 if config. has_cfg_prefix ( ln, "only" ) {
974989 ignore = match config. parse_cfg_name_directive ( ln, "only" ) {
975990 ParsedNameDirective :: Match => ignore,
976- ParsedNameDirective :: NoMatch => true ,
991+ ParsedNameDirective :: NoMatch => {
992+ ignore_message = Some ( "cfg -> only => NoMatch" ) ;
993+ true
994+ }
977995 } ;
978996 }
979- ignore |= ignore_llvm ( config, ln) ;
980- ignore |=
981- config. run_clang_based_tests_with . is_none ( ) && config. parse_needs_matching_clang ( ln) ;
982- ignore |= !has_asm_support && config. parse_name_directive ( ln, "needs-asm-support" ) ;
983- ignore |= !rustc_has_profiler_support && config. parse_needs_profiler_support ( ln) ;
984- ignore |= !config. run_enabled ( ) && config. parse_name_directive ( ln, "needs-run-enabled" ) ;
985- ignore |= !rustc_has_sanitizer_support
986- && config. parse_name_directive ( ln, "needs-sanitizer-support" ) ;
987- ignore |= !has_asan && config. parse_name_directive ( ln, "needs-sanitizer-address" ) ;
988- ignore |= !has_cfi && config. parse_name_directive ( ln, "needs-sanitizer-cfi" ) ;
989- ignore |= !has_kcfi && config. parse_name_directive ( ln, "needs-sanitizer-kcfi" ) ;
990- ignore |= !has_lsan && config. parse_name_directive ( ln, "needs-sanitizer-leak" ) ;
991- ignore |= !has_msan && config. parse_name_directive ( ln, "needs-sanitizer-memory" ) ;
992- ignore |= !has_tsan && config. parse_name_directive ( ln, "needs-sanitizer-thread" ) ;
993- ignore |= !has_hwasan && config. parse_name_directive ( ln, "needs-sanitizer-hwaddress" ) ;
994- ignore |= !has_memtag && config. parse_name_directive ( ln, "needs-sanitizer-memtag" ) ;
995- ignore |= !has_shadow_call_stack
996- && config. parse_name_directive ( ln, "needs-sanitizer-shadow-call-stack" ) ;
997- ignore |= !config. can_unwind ( ) && config. parse_name_directive ( ln, "needs-unwind" ) ;
998- ignore |= config. target == "wasm32-unknown-unknown"
999- && config. parse_name_directive ( ln, directives:: CHECK_RUN_RESULTS ) ;
1000- ignore |= config. debugger == Some ( Debugger :: Cdb ) && ignore_cdb ( config, ln) ;
1001- ignore |= config. debugger == Some ( Debugger :: Gdb ) && ignore_gdb ( config, ln) ;
1002- ignore |= config. debugger == Some ( Debugger :: Lldb ) && ignore_lldb ( config, ln) ;
1003- ignore |= !has_rust_lld && config. parse_name_directive ( ln, "needs-rust-lld" ) ;
997+
998+ reason ! ( ignore_llvm( config, ln) ) ;
999+ reason ! (
1000+ config. run_clang_based_tests_with. is_none( ) && config. parse_needs_matching_clang( ln)
1001+ ) ;
1002+ reason ! ( !has_asm_support && config. parse_name_directive( ln, "needs-asm-support" ) ) ;
1003+ reason ! ( !rustc_has_profiler_support && config. parse_needs_profiler_support( ln) ) ;
1004+ reason ! ( !config. run_enabled( ) && config. parse_name_directive( ln, "needs-run-enabled" ) ) ;
1005+ reason ! (
1006+ !rustc_has_sanitizer_support
1007+ && config. parse_name_directive( ln, "needs-sanitizer-support" )
1008+ ) ;
1009+ reason ! ( !has_asan && config. parse_name_directive( ln, "needs-sanitizer-address" ) ) ;
1010+ reason ! ( !has_cfi && config. parse_name_directive( ln, "needs-sanitizer-cfi" ) ) ;
1011+ reason ! ( !has_kcfi && config. parse_name_directive( ln, "needs-sanitizer-kcfi" ) ) ;
1012+ reason ! ( !has_lsan && config. parse_name_directive( ln, "needs-sanitizer-leak" ) ) ;
1013+ reason ! ( !has_msan && config. parse_name_directive( ln, "needs-sanitizer-memory" ) ) ;
1014+ reason ! ( !has_tsan && config. parse_name_directive( ln, "needs-sanitizer-thread" ) ) ;
1015+ reason ! ( !has_hwasan && config. parse_name_directive( ln, "needs-sanitizer-hwaddress" ) ) ;
1016+ reason ! ( !has_memtag && config. parse_name_directive( ln, "needs-sanitizer-memtag" ) ) ;
1017+ reason ! (
1018+ !has_shadow_call_stack
1019+ && config. parse_name_directive( ln, "needs-sanitizer-shadow-call-stack" )
1020+ ) ;
1021+ reason ! ( !config. can_unwind( ) && config. parse_name_directive( ln, "needs-unwind" ) ) ;
1022+ reason ! (
1023+ config. target == "wasm32-unknown-unknown"
1024+ && config. parse_name_directive( ln, directives:: CHECK_RUN_RESULTS )
1025+ ) ;
1026+ reason ! ( config. debugger == Some ( Debugger :: Cdb ) && ignore_cdb( config, ln) ) ;
1027+ reason ! ( config. debugger == Some ( Debugger :: Gdb ) && ignore_gdb( config, ln) ) ;
1028+ reason ! ( config. debugger == Some ( Debugger :: Lldb ) && ignore_lldb( config, ln) ) ;
1029+ reason ! ( !has_rust_lld && config. parse_name_directive( ln, "needs-rust-lld" ) ) ;
10041030 should_fail |= config. parse_name_directive ( ln, "should-fail" ) ;
10051031 } ) ;
10061032
0 commit comments