LLZK 0.1.0
Veridise's ZK Language IR
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

virtual ~TestGenerator ()=default
virtual void genTestClassPrologue () const
 Generate the test class prologue.
virtual void genIsATest () const
 Generate IsA test for a class.
virtual 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 setDialectAndClassName (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
const mlir::tblgen::Dialect * dialect
mlir::StringRef className

Detailed Description

Generator for common test implementation file elements.

Definition at line 560 of file CommonCAPIGen.h.

Constructor & Destructor Documentation

◆ ~TestGenerator()

virtual TestGenerator::~TestGenerator ( )
virtualdefault

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 654 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()

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

Generate test for an extra method from extraClassDeclaration.

Implements Generator.

Definition at line 585 of file CommonCAPIGen.h.

◆ genIsATest()

virtual void TestGenerator::genIsATest ( ) const
inlinevirtual

Generate IsA test for a class.

Definition at line 571 of file CommonCAPIGen.h.

◆ genTestClassPrologue()

virtual void TestGenerator::genTestClassPrologue ( ) const
inlinevirtual

Generate the test class prologue.

Definition at line 565 of file CommonCAPIGen.h.


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