CIRCT  19.0.0git
Public Member Functions | Private Attributes | List of all members
circt::Tester Class Reference

A testing environment for reduction attempts. More...

#include <Tester.h>

Collaboration diagram for circt::Tester:
Collaboration graph
[legend]

Public Member Functions

 Tester (llvm::StringRef testScript, llvm::ArrayRef< std::string > testScriptArgs, bool testMustFail)
 
std::pair< bool, size_t > isInteresting (mlir::ModuleOp module) const
 Runs the interestingness testing script on a MLIR test case file. More...
 
bool isInteresting (llvm::StringRef testCase) const
 Return whether the file in the given path is interesting. More...
 
TestCase get (mlir::ModuleOp module) const
 Create a new test case for the given module. More...
 
TestCase get (llvm::Twine filepath) const
 Create a new test case for the given file already on disk. More...
 

Private Attributes

llvm::StringRef testScript
 The binary to execute in order to check a reduction attempt for interestingness. More...
 
llvm::ArrayRef< std::string > testScriptArgs
 Additional arguments to pass to testScript. More...
 
bool testMustFail
 Consider the testcase to be interesting if it fails rather than on exit code 0. More...
 

Detailed Description

A testing environment for reduction attempts.

This class tracks the program used to check reduction attempts for interestingness and additional arguments to pass to that tool. Use get() to obtain a new test case that can be queried for information on an individual MLIR module.

Definition at line 37 of file Tester.h.

Constructor & Destructor Documentation

◆ Tester()

Tester::Tester ( llvm::StringRef  testScript,
llvm::ArrayRef< std::string >  testScriptArgs,
bool  testMustFail 
)

Definition at line 25 of file Tester.cpp.

Member Function Documentation

◆ get() [1/2]

TestCase Tester::get ( llvm::Twine  filepath) const

Create a new test case for the given file already on disk.

Definition at line 67 of file Tester.cpp.

◆ get() [2/2]

TestCase Tester::get ( mlir::ModuleOp  module) const

Create a new test case for the given module.

Definition at line 62 of file Tester.cpp.

◆ isInteresting() [1/2]

bool circt::Tester::isInteresting ( llvm::StringRef  testCase) const

Return whether the file in the given path is interesting.

◆ isInteresting() [2/2]

std::pair<bool, size_t> circt::Tester::isInteresting ( mlir::ModuleOp  module) const

Runs the interestingness testing script on a MLIR test case file.

Returns true if the interesting behavior is present in the test case or false otherwise.

Referenced by circt::TestCase::isInteresting().

Member Data Documentation

◆ testMustFail

bool circt::Tester::testMustFail
private

Consider the testcase to be interesting if it fails rather than on exit code 0.

Definition at line 66 of file Tester.h.

◆ testScript

llvm::StringRef circt::Tester::testScript
private

The binary to execute in order to check a reduction attempt for interestingness.

Definition at line 59 of file Tester.h.

◆ testScriptArgs

llvm::ArrayRef<std::string> circt::Tester::testScriptArgs
private

Additional arguments to pass to testScript.

Definition at line 62 of file Tester.h.


The documentation for this class was generated from the following files: