Codegen: add @qltest.test_with

This allows to group together related AST classes to reuse the same
test source and extraction. For example this is useful for
`EnumDecl/EnumCaseDecl/EnumElementDecl`, where this is applied to.
This commit is contained in:
Paolo Tranquilli
2023-10-23 14:22:26 +02:00
parent 319b799f95
commit 7cc20587ad
26 changed files with 256 additions and 13 deletions

View File

@@ -93,6 +93,7 @@ class Class:
doc: List[str] = field(default_factory=list)
default_doc_name: Optional[str] = None
hideable: bool = False
test_with: Optional[str] = None
@property
def final(self):
@@ -110,6 +111,7 @@ class Class:
if self.synth.on_arguments is not None:
for t in self.synth.on_arguments.values():
_check_type(t, known)
_check_type(self.test_with, known)
@dataclass