Skip to content

Commit

Permalink
test: cache and filter results using domain too in parser tests
Browse files Browse the repository at this point in the history
Currently the domain is handled indirectly via -x<language> option in
clang_args, but prepare for moving the option at a lower level.
  • Loading branch information
jnikula committed Nov 9, 2023
1 parent 7860c52 commit 7227ca7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 7227ca7

Please sign in to comment.