P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::P4Tools::P4Testgen::Pna::PnaTestBackend Class Reference
Inheritance diagram for P4::P4Tools::P4Testgen::Pna::PnaTestBackend:
[legend]

Public Member Functions

 PnaTestBackend (const ProgramInfo &programInfo, const TestBackendConfiguration &testBackendConfiguration, SymbolicExecutor &symbex)
 
const TestSpeccreateTestSpec (const ExecutionState *executionState, const Model *finalModel, const TestInfo &testInfo) override
 
TestBackEnd::TestInfo produceTestInfo (const ExecutionState *executionState, const Model *finalModel, const IR::Expression *outputPacketExpr, const IR::Expression *outputPortExpr, const std::vector< std::reference_wrapper< const TraceEvent > > *programTraces) override
 
- Public Member Functions inherited from P4::P4Tools::P4Testgen::TestBackEnd
 TestBackEnd (const TestBackEnd &)=default
 
 TestBackEnd (TestBackEnd &&)=default
 
std::optional< std::reference_wrapper< const FinalState > > computeConcolicVariables (const FinalState &state) const
 
float getCoverage () const
 Returns coverage achieved by all the processed tests.
 
const ProgramInfogetProgramInfo () const
 Returns the program info.
 
const TestBackendConfigurationgetTestBackendConfiguration () const
 Returns the configuration options for the test back end.
 
int64_t getTestCount () const
 Returns test count.
 
const AbstractTestList & getTests () const
 
TestBackEndoperator= (const TestBackEnd &)=delete
 
TestBackEndoperator= (TestBackEnd &&)=delete
 
virtual bool printTestInfo (const ExecutionState *executionState, const TestInfo &testInfo, const IR::Expression *outputPortExpr)
 
virtual bool run (const FinalState &state)
 The callback that is executed by the symbolic executor.
 

Additional Inherited Members

- Protected Member Functions inherited from P4::P4Tools::P4Testgen::TestBackEnd
 TestBackEnd (const ProgramInfo &programInfo, const TestBackendConfiguration &testBackendConfiguration, SymbolicExecutor &symbex)
 
bool needsToTerminate (int64_t testCount) const
 
- Protected Attributes inherited from P4::P4Tools::P4Testgen::TestBackEnd
float coverage = 0
 The accumulated coverage of all finished test cases. Number in range [0, 1].
 
int64_t maxTests
 Test maximum number of tests that are to be produced.
 
SymbolicExecutorsymbex
 
AbstractTestList tests
 The list of tests accumulated in the test back end.
 
TestFrameworktestWriter = nullptr
 Writes the tests out to a file.
 

Member Function Documentation

◆ createTestSpec()

const TestSpec * P4::P4Tools::P4Testgen::Pna::PnaTestBackend::createTestSpec ( const ExecutionState * executionState,
const Model * finalModel,
const TestInfo & testInfo )
overridevirtual
Returns
the test specification which is consumed by the test back ends.

Implements P4::P4Tools::P4Testgen::TestBackEnd.

◆ produceTestInfo()

TestBackEnd::TestInfo P4::P4Tools::P4Testgen::Pna::PnaTestBackend::produceTestInfo ( const ExecutionState * executionState,
const Model * finalModel,
const IR::Expression * outputPacketExpr,
const IR::Expression * outputPortExpr,
const std::vector< std::reference_wrapper< const TraceEvent > > * programTraces )
overridevirtual
Returns
a TestInfo objects, which contains information about the input/output ports, the taint mask, the packet sizes, etc...

Reimplemented from P4::P4Tools::P4Testgen::TestBackEnd.