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/lib/test_framework.h"
7#include "backends/p4tools/modules/testgen/options.h"
8
9namespace P4::P4Tools::P4Testgen {
10
12class Testgen : public AbstractP4cTool<TestgenOptions> {
13 protected:
14 void registerTarget() override;
15
16 int mainImpl(const CompilerResult &compilerResult) override;
17
18 public:
23 static std::optional<AbstractTestList> generateTests(const CompilerOptions &options,
24 const TestgenOptions &testgenOptions);
30 static std::optional<AbstractTestList> generateTests(std::string_view program,
31 const CompilerOptions &options,
32 const TestgenOptions &testgenOptions);
33
39 static int writeTests(const CompilerOptions &options, const TestgenOptions &testgenOptions);
40
45 static int writeTests(std::string_view program, const CompilerOptions &options,
46 const TestgenOptions &testgenOptions);
47
48 virtual ~Testgen() = default;
49};
50
51} // namespace P4::P4Tools::P4Testgen
52
53#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TESTGEN_H_ */
Definition frontends/common/options.h:30
Definition p4ctool.h:22
Definition common/compiler/compiler_result.h:14
This is main implementation of the P4Testgen tool.
Definition testgen.h:12
int mainImpl(const CompilerResult &compilerResult) override
Definition testgen.cpp:197
static int writeTests(const CompilerOptions &options, const TestgenOptions &testgenOptions)
Definition testgen.cpp:251
static std::optional< AbstractTestList > generateTests(const CompilerOptions &options, const TestgenOptions &testgenOptions)
Definition testgen.cpp:223
Encapsulates and processes command-line options for P4Testgen.
Definition backends/p4tools/modules/testgen/options.h:19