P4C
The P4 Compiler
Loading...
Searching...
No Matches
targets/bmv2/test/gtest_utils.h
1#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_GTEST_UTILS_H_
2#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_GTEST_UTILS_H_
3
4#include "backends/p4tools/modules/testgen/test/gtest_utils.h"
5#include "backends/p4tools/modules/testgen/test/small-step/util.h"
6
7namespace P4::P4Tools::Test {
8
11 std::unique_ptr<AutoCompileContext> compileContext;
12
13 public:
14 void SetUp() override {
15 compileContext = P4TestgenTest::SetUp("bmv2", "v1model");
16 if (compileContext == nullptr) {
17 FAIL() << "Failed to set up P4Testgen BMv2 test";
18 return;
19 }
20 }
21};
22
24std::optional<const P4ToolsTestCase> createBmv2V1modelSmallStepExprTest(
25 const std::string &hdrFields, const std::string &expr);
26
28 std::unique_ptr<AutoCompileContext> compileContext;
29
30 public:
31 void SetUp() override {
32 compileContext = P4TestgenTest::SetUp("bmv2", "v1model");
33 if (compileContext == nullptr) {
34 FAIL() << "Failed to set up P4Testgen BMv2 test";
35 return;
36 }
37 }
38};
39
40} // namespace P4::P4Tools::Test
41
42#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_GTEST_UTILS_H_ */
Definition targets/bmv2/test/gtest_utils.h:27
Sets up the correct context for a P4Testgen BMv2 test.
Definition targets/bmv2/test/gtest_utils.h:10
Definition test/gtest_utils.h:55
static std::unique_ptr< AutoCompileContext > SetUp(std::string_view target, std::string_view archName)
Definition test/gtest_utils.h:57
Definition modules/testgen/test/small-step/util.h:40