LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
TestGenerator Struct Reference

Generator for common test implementation file elements. More...

#include <CommonCAPIGen.h>

Inheritance diagram for TestGenerator:
[legend]
Collaboration diagram for TestGenerator:
[legend]

Public Member Functions

 ~TestGenerator () override=default
virtual void genTestClassPrologue () const
 Generate the test class prologue.
virtual void genIsATest () const
 Generate IsA test for a class.
void genExtraMethod (const ExtraMethod &method) const override
 Generate test for an extra method from extraClassDeclaration.
virtual std::string genCleanup () const
 Generate cleanup code for test methods.
 Generator (std::string_view recordKind, llvm::raw_ostream &outputStream)
Public Member Functions inherited from Generator
 Generator (std::string_view recordKind, llvm::raw_ostream &outputStream)
virtual ~Generator ()=default
virtual void setNamespaceAndClassName (const mlir::tblgen::Dialect &d, mlir::StringRef cppClassName)
 Set the dialect and class name for code generation.
virtual void genExtraMethods (mlir::StringRef extraDecl) const
 Generate code for extra methods from an extraClassDeclaration

Additional Inherited Members

Protected Attributes inherited from Generator
std::string kind
llvm::raw_ostream & os
std::string dialectNameCapitalized
mlir::StringRef dialectNamespace
mlir::StringRef className

Detailed Description

Generator for common test implementation file elements.

Definition at line 561 of file CommonCAPIGen.h.

Constructor & Destructor Documentation

◆ ~TestGenerator()

TestGenerator::~TestGenerator ( )
overridedefault

Member Function Documentation

◆ genCleanup()

virtual std::string TestGenerator::genCleanup ( ) const
inlinevirtual

Generate cleanup code for test methods.

Returns
String containing the cleanup function name or comment marker

This method generates the cleanup code that should be called at the end of each test to properly release resources. The default implementation returns "//" which comments out the cleanup call (for types/attributes that don't need explicit cleanup). Derived classes should override this to return the appropriate cleanup function name (e.g., "mlirOperationDestroy" for operations).

Definition at line 655 of file CommonCAPIGen.h.

◆ Generator()

Generator::Generator ( std::string_view recordKind,
llvm::raw_ostream & outputStream )
inline

Definition at line 324 of file CommonCAPIGen.h.

◆ genExtraMethod()

void TestGenerator::genExtraMethod ( const ExtraMethod & method) const
inlineoverridevirtual

Generate test for an extra method from extraClassDeclaration.

Implements Generator.

Definition at line 586 of file CommonCAPIGen.h.

◆ genIsATest()

virtual void TestGenerator::genIsATest ( ) const
inlinevirtual

Generate IsA test for a class.

Definition at line 572 of file CommonCAPIGen.h.

◆ genTestClassPrologue()

virtual void TestGenerator::genTestClassPrologue ( ) const
inlinevirtual

Generate the test class prologue.

Definition at line 566 of file CommonCAPIGen.h.


The documentation for this struct was generated from the following file: