From 7227ca720d2dbd701f41e619577fb77ecb5a66b9 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 9 Nov 2023 22:26:43 +0200 Subject: [PATCH] test: cache and filter results using domain too in parser tests Currently the domain is handled indirectly via -x option in clang_args, but prepare for moving the option at a lower level. --- test/test_parser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/test_parser.py b/test/test_parser.py index b8207d62..27c92040 100755 --- a/test/test_parser.py +++ b/test/test_parser.py @@ -77,7 +77,7 @@ def get_output(self): clang_args = directive.get_clang_args() - key = (filename, tuple(clang_args)) + key = (filename, directive.domain, tuple(clang_args)) if key in roots: continue @@ -91,12 +91,16 @@ def get_output(self): for directive in self.directives: filename = directive.get_input_filename() filter_filenames = [filename] if filename is not None else None + filter_domains = [directive.domain] filter_clang_args = [directive.get_clang_args()] for root in roots.values(): if filter_filenames is not None and root.get_filename() not in filter_filenames: continue + if filter_domains is not None and root.get_domain() not in filter_domains: + continue + if filter_clang_args is not None and root.get_clang_args() not in filter_clang_args: continue