Allow unit test to parse testcase blocks

When a unittest introspect a meson.build file from a test case,
the file may contain a testcase block. We should ignore this block.
pull/10594/head
Charles Brunet 1 year ago committed by Nirbheek Chauhan
parent d2dfef5205
commit 8caf40e5ae
  1. 5
      mesonbuild/ast/interpreter.py

@ -29,6 +29,7 @@ from ..interpreterbase import (
InvalidArguments,
BreakRequest,
ContinueRequest,
Disabler,
default_resolve_key,
)
@ -53,6 +54,7 @@ from ..mparser import (
NotNode,
PlusAssignmentNode,
TernaryNode,
TestCaseClauseNode,
)
if T.TYPE_CHECKING:
@ -444,3 +446,6 @@ class AstInterpreter(InterpreterBase):
elif isinstance(val, (str, bool, int, float)) or include_unknown_args:
flattened_kwargs[key] = val
return flattened_kwargs
def evaluate_testcase(self, node: TestCaseClauseNode) -> Disabler | None:
return Disabler(subproject=self.subproject)

Loading…
Cancel
Save