![]() |
P4C
The P4 Compiler
|
Encapsulates and processes command-line options for P4Testgen. More...
Public Member Functions | |
| const char * | getIncludePath () override |
Public Member Functions inherited from P4Tools::AbstractP4cToolOptions | |
| std::optional< ICompileContext * > | process (const std::vector< const char * > &args) |
Static Public Member Functions | |
| static TestgenOptions & | get () |
Public Attributes | |
| bool | assertionModeEnabled = false |
| P4::Coverage::CoverageOptions | coverageOptions |
| bool | dcg = false |
| bool | droppedPacketOnly = false |
| Enforces the test generation of tests with mandatory dropped packet. | |
| bool | enforceAssumptions = true |
| bool | hasCoverageTracking = false |
| int | maxPktSize = 12000 |
| The maximum permitted packet size, in bits. | |
| int64_t | maxTests = 1 |
| Maximum number of tests to be generated. Defaults to 1. | |
| float | minCoverage = 0 |
| Specifies minimum coverage that needs to be achieved for P4Testgen to exit successfully. | |
| int | minPktSize = 0 |
| The minimum permitted packet size, in bits. | |
| std::optional< std::filesystem::path > | outputDir = std::nullopt |
| Directory for generated tests. Defaults to PWD. | |
| bool | outputPacketOnly = false |
| Enforces the test generation of tests with mandatory output packet. | |
| P4Testgen::PathSelectionPolicy | pathSelectionPolicy = P4Testgen::PathSelectionPolicy::DepthFirst |
| Selects the path selection policy for test generation. | |
| std::string | pattern |
| String of a pattern for resulting tests. | |
| std::vector< std::pair< int, int > > | permittedPortRanges |
| std::string | selectedBranches |
| String of selected branches separated by comma. | |
| std::set< cstring > | skippedControlPlaneEntities |
| Skip generating a control plane entry for the entities in this list. | |
| cstring | stopMetric |
| bool | strict = false |
| Fail on unimplemented features instead of trying the next branch. | |
| cstring | testBackend |
| The test back end that P4Testgen will generate test for. Examples are STF, PTF or Protobuf. | |
| std::optional< cstring > | testBaseName |
| bool | trackBranches = false |
Public Attributes inherited from P4Tools::AbstractP4cToolOptions | |
| bool | disableInformationLogging = false |
| Disable information logging. | |
| std::optional< uint32_t > | seed = std::nullopt |
| A seed for the PRNG. | |
Static Public Attributes | |
| static const std::set< cstring > | SUPPORTED_STOP_METRICS = {"MAX_NODE_COVERAGE"} |
| List of the supported stop metrics. | |
Protected Member Functions | |
| bool | validateOptions () const override |
Protected Member Functions inherited from P4Tools::AbstractP4cToolOptions | |
| AbstractP4cToolOptions (const AbstractP4cToolOptions &)=delete | |
| AbstractP4cToolOptions (cstring message) | |
| AbstractP4cToolOptions & | operator= (const AbstractP4cToolOptions &)=delete |
| std::vector< const char * > * | process (int argc, char *const argv[]) override |
| Hook for customizing options processing. | |
Protected Member Functions inherited from Util::Options | |
| Options (cstring message) | |
| void | registerOption (const char *option, const char *argName, OptionProcessor processor, const char *description, OptionFlags flags=OptionFlags::Default) |
| void | registerUsage (const char *msg) |
| void | setOutStream (std::ostream *out) |
| cstring | getBinaryName () |
| cstring | getBuildDate () |
| cstring | getCompileCommand () |
| virtual void | usage () |
Additional Inherited Members | |
Protected Types inherited from Util::Options | |
| enum | OptionFlags { Default = 0 , Hide = 1 << 0 , OptionalArgument = 1 << 1 } |
| typedef std::function< bool(const char *optarg)> | OptionProcessor |
Static Protected Member Functions inherited from P4Tools::AbstractP4cToolOptions | |
| static std::tuple< int, char ** > | convertArgs (const std::vector< const char * > &args) |
| Converts a vector of command-line arguments into the traditional (argc, argv) format. | |
Protected Attributes inherited from P4Tools::AbstractP4cToolOptions | |
| std::vector< const char * > | compilerArgs |
| Command-line arguments to be sent to the compiler. Populated by @process. | |
Protected Attributes inherited from Util::Options | |
| std::vector< const char * > | additionalUsage |
| const char * | binaryName |
| cstring | buildDate |
| bool | collectUnknownOptions = false |
| cstring | compileCommand |
| cstring | message |
| std::vector< cstring > | optionOrder |
| std::map< cstring, const Option * > | options |
| std::ostream * | outStream = &std::cerr |
| std::vector< const char * > | remainingOptions |
Encapsulates and processes command-line options for P4Testgen.
|
static |
|
overrideprotectedvirtual |
Checks if parsed options make sense with respect to each-other.
Reimplemented from P4Tools::AbstractP4cToolOptions.
| bool P4Tools::P4Testgen::TestgenOptions::assertionModeEnabled = false |
Produce only tests that violate the condition defined in assert calls. This will either produce no tests or only tests that contain counter examples.
| P4::Coverage::CoverageOptions P4Tools::P4Testgen::TestgenOptions::coverageOptions |
Specifies general options which IR nodes to track for coverage in the targeted P4 program. Multiple options are possible. Currently supported: STATEMENTS, TABLE_ENTRIES.
| bool P4Tools::P4Testgen::TestgenOptions::dcg = false |
Build a DCG for input program. This control flow graph directed cyclic graph can be used for statement reachability analysis.
| bool P4Tools::P4Testgen::TestgenOptions::enforceAssumptions = true |
Add conditions defined in assert/assume to the path conditions. Only tests which satisfy these conditions can be generated. This is active by default.
| bool P4Tools::P4Testgen::TestgenOptions::hasCoverageTracking = false |
Indicates that coverage tracking is enabled for some coverage criteria. This is used for sanity checking and it also affects information printed to output.
| std::vector<std::pair<int, int> > P4Tools::P4Testgen::TestgenOptions::permittedPortRanges |
The list of permitted port ranges. TestGen will consider these when choosing input and output ports.
| std::optional<cstring> P4Tools::P4Testgen::TestgenOptions::testBaseName |
The base name of the tests which are generated. Defaults to the name of the input program, if provided.
| bool P4Tools::P4Testgen::TestgenOptions::trackBranches = false |
Track the branches that are executed in the symbolic executor. This can be used for deterministic replay of an execution trace.