P4C
The P4 Compiler
Loading...
Searching...
No Matches
testgen.h
1#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TESTGEN_H_
2#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TESTGEN_H_
3
4#include "backends/p4tools/common/p4ctool.h"
5
6#include "backends/p4tools/modules/testgen/core/target.h"
7#include "backends/p4tools/modules/testgen/lib/test_framework.h"
8#include "backends/p4tools/modules/testgen/options.h"
9
10namespace P4::P4Tools::P4Testgen {
11
13class Testgen : public AbstractP4cTool<TestgenOptions> {
14 protected:
15 void registerTarget() override;
16
17 int mainImpl(const CompilerResult &compilerResult) override;
18
19 public:
24 static std::optional<AbstractTestList> generateTests(const TestgenOptions &testgenOptions);
30 static std::optional<AbstractTestList> generateTests(std::string_view program,
31 const TestgenOptions &testgenOptions);
32
38 static int writeTests(const TestgenOptions &testgenOptions);
39
44 static int writeTests(std::string_view program, const TestgenOptions &testgenOptions);
45
46 virtual ~Testgen() = default;
47};
48
49} // namespace P4::P4Tools::P4Testgen
50
51#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TESTGEN_H_ */
Definition p4ctool.h:22
Definition common/compiler/compiler_result.h:14
This is main implementation of the P4Testgen tool.
Definition testgen.h:13
static std::optional< AbstractTestList > generateTests(const TestgenOptions &testgenOptions)
Definition testgen.cpp:221
static int writeTests(const TestgenOptions &testgenOptions)
Definition testgen.cpp:247
int mainImpl(const CompilerResult &compilerResult) override
Definition testgen.cpp:196
Encapsulates and processes command-line options for P4Testgen.
Definition backends/p4tools/modules/testgen/options.h:19