P4C
The P4 Compiler
|
Extracts information from the @testSpec to emit a Protobuf IR test case. More...
#include <protobuf_ir.h>
Public Member Functions | |
ProtobufIr (const ProtobufIr &)=default | |
ProtobufIr (const TestBackendConfiguration &testBackendConfiguration, P4::P4RuntimeAPI p4RuntimeApi) | |
ProtobufIr (ProtobufIr &&)=default | |
ProtobufIr & | operator= (const ProtobufIr &)=default |
ProtobufIr & | operator= (ProtobufIr &&)=default |
AbstractTestReferenceOrError | produceTest (const TestSpec *testSpec, cstring selectedBranches, size_t testIdx, float currentCoverage) override |
void | writeTestToFile (const TestSpec *testSpec, cstring selectedBranches, size_t testId, float currentCoverage) override |
Public Member Functions inherited from P4::P4Tools::P4Testgen::Bmv2::Bmv2TestFramework | |
Bmv2TestFramework (const TestBackendConfiguration &testBackendConfiguration) | |
Public Member Functions inherited from P4::P4Tools::P4Testgen::TestFramework | |
bool | isInFileMode () const |
@Returns true if the test framework is configured to write to a file. | |
Additional Inherited Members | |
Protected Member Functions inherited from P4::P4Tools::P4Testgen::Bmv2::Bmv2TestFramework | |
virtual inja::json | getClone (const TestObjectMap &cloneSpecs) const |
Returns the configuration for a cloned packet configuration. | |
virtual inja::json | getControlPlane (const TestSpec *testSpec) const |
Converts all the control plane objects into Inja format. | |
virtual inja::json::array_t | getMeter (const TestObjectMap &meterValues) const |
Protected Member Functions inherited from P4::P4Tools::P4Testgen::TestFramework | |
TestFramework (const TestBackendConfiguration &testBackendConfiguration) | |
Creates a generic test framework. | |
const TestBackendConfiguration & | getTestBackendConfiguration () const |
Returns the configuration options for the test back end. | |
Static Protected Member Functions inherited from P4::P4Tools::P4Testgen::Bmv2::Bmv2TestFramework | |
static std::string | formatHexExpressionWithSeparators (const IR::Expression &expr) |
Wrapper helper function that automatically inserts separators for hex strings. | |
Static Protected Member Functions inherited from P4::P4Tools::P4Testgen::TestFramework | |
static void | checkForDefaultActionOverride (inja::json &tblJson, const TableConfig *tblConfig) |
template<class ProfileType , class SelectorType > | |
static void | checkForTableActionProfile (inja::json &tblJson, std::map< cstring, cstring > &apAsMap, const TableConfig *tblConfig) |
template<class ProfileType > | |
static void | collectActionProfileDeclarations (const TestSpec *testSpec, inja::json &controlPlaneJson, const std::map< cstring, cstring > &apAsMap) |
Collect all the action profile objects. These will have to be declared in the test. | |
static inja::json | getTrace (const TestSpec *testSpec) |
Converts the traces of this test into a string representation and Inja object. | |
Extracts information from the @testSpec to emit a Protobuf IR test case.
|
overridevirtual |
The method used to return the test case. This method is optional to each test framework.
spec | the testcase specification to be outputted. |
selectedBranches | string describing branches selected for this testcase. |
testIdx | testcase unique number identifier. TODO: Make this a member? |
currentCoverage | current coverage ratio (between 0.0 and 1.0). |
Reimplemented from P4::P4Tools::P4Testgen::TestFramework.
|
overridevirtual |
The method used to output the test case to be implemented by all the test frameworks (eg. STF, PTF, etc.).
spec | the testcase specification to be outputted. |
selectedBranches | string describing branches selected for this testcase. |
testIdx | testcase unique number identifier. TODO: Make this a member? |
currentCoverage | current coverage ratio (between 0.0 and 1.0) TODO (https://github.com/p4lang/p4c/issues/4403): This should not return void but instead a status. |
Implements P4::P4Tools::P4Testgen::TestFramework.