From ecd46edd613433154b3d0eeb25af27234f6f98eb Mon Sep 17 00:00:00 2001 From: David Greene Date: Mon, 31 Jan 2022 07:06:08 -0800 Subject: [UpdateTestChecks] Re-add --filter and --filter-out options Re-add filtering options with fixes for failed tests. We were not passing the is_filtered argument in all check generator calls in update_cc_test_checks.py Enhance the various update_*_test_checks.py tools to allow filtering the tool output with regular expressions. The --filter option will emit only tool output lines matching the given regular expression while the --filter-out option will emit only tools output lines not matching the given regular expression. Filters are applied in order of appearance on the command line (or in UTC_ARGS) and the first matching filter terminates the search. This allows test authors to create more focused tests by removing irrelevant tool output and checking only the pieces of output necessary to test the desired functionality. Differential Revision: https://reviews.llvm.org/D117694 --- llvm/utils/UpdateTestChecks/asm.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'llvm/utils/UpdateTestChecks/asm.py') diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py index c24849b..95d17ba 100644 --- a/llvm/utils/UpdateTestChecks/asm.py +++ b/llvm/utils/UpdateTestChecks/asm.py @@ -456,8 +456,11 @@ def get_run_handler(triple): ##### Generator of assembly CHECK lines -def add_asm_checks(output_lines, comment_marker, prefix_list, func_dict, func_name): +def add_asm_checks(output_lines, comment_marker, prefix_list, func_dict, + func_name, is_filtered): # Label format is based on ASM string. check_label_format = '{} %s-LABEL: %s%s:'.format(comment_marker) global_vars_seen_dict = {} - common.add_checks(output_lines, comment_marker, prefix_list, func_dict, func_name, check_label_format, True, False, global_vars_seen_dict) + common.add_checks(output_lines, comment_marker, prefix_list, func_dict, + func_name, check_label_format, True, False, + global_vars_seen_dict, is_filtered = is_filtered) -- cgit v1.1