@@ -356,6 +356,10 @@ def main():
356356 metavar = 'PATTERN' , default = [],
357357 help = 'Exclude checks whose name matches PATTERN'
358358 )
359+ select_options .add_argument (
360+ '-E' , '--filter-expr' , action = 'store' , metavar = 'EXPR' ,
361+ help = 'Select checks that satisfy the expression EXPR'
362+ )
359363
360364 # Action options
361365 action_options .add_argument (
@@ -1048,6 +1052,16 @@ def print_infoline(param, value):
10481052 f'Filtering test cases(s) by tags: { len (testcases )} remaining'
10491053 )
10501054
1055+ if options .filter_expr :
1056+ testcases = filter (filters .validates (options .filter_expr ),
1057+ testcases )
1058+
1059+ testcases = list (testcases )
1060+ printer .verbose (
1061+ f'Filtering test cases(s) by { options .filter_expr } : '
1062+ f'{ len (testcases )} remaining'
1063+ )
1064+
10511065 # Filter test cases by maintainers
10521066 for maint in options .maintainers :
10531067 testcases = filter (filters .have_maintainer (maint ), testcases )
@@ -1059,8 +1073,12 @@ def print_infoline(param, value):
10591073 sys .exit (1 )
10601074
10611075 if options .gpu_only :
1076+ printer .warning ('the `--gpu-only` option is deprecated; '
1077+ 'please use `-E num_gpus_per_node` instead' )
10621078 testcases = filter (filters .have_gpu_only (), testcases )
10631079 elif options .cpu_only :
1080+ printer .warning ('the `--cpu-only` option is deprecated; '
1081+ 'please use `-E "not num_gpus_per_node"` instead' )
10641082 testcases = filter (filters .have_cpu_only (), testcases )
10651083
10661084 testcases = list (testcases )
0 commit comments