1#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_PNA_BACKEND_PTF_PTF_H_
2#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_PNA_BACKEND_PTF_PTF_H_
12#include <inja/inja.hpp>
16#include "lib/cstring.h"
18#include "backends/p4tools/modules/testgen/lib/test_framework.h"
19#include "backends/p4tools/modules/testgen/lib/test_object.h"
20#include "backends/p4tools/modules/testgen/lib/test_spec.h"
27 bool preambleEmitted =
false;
30 std::ofstream ptfFileStream;
33 ~PTF()
override =
default;
36 PTF &operator=(
const PTF &) =
delete;
37 PTF &operator=(
PTF &&) =
delete;
43 float currentCoverage)
override;
55 void emitTestcase(
const TestSpec *testSpec,
cstring selectedBranches,
size_t testId,
56 const std::string &testCase,
float currentCoverage);
59 static std::string getTestCaseTemplate();
62 static inja::json getControlPlane(
const TestSpec *testSpec);
65 static inja::json getSend(
const TestSpec *testSpec);
68 static inja::json getVerify(
const TestSpec *testSpec);
72 static std::vector<std::pair<size_t, size_t>> getIgnoreMasks(
const IR::Constant *mask);
75 static inja::json getControlPlaneForTable(
const TableMatchMap &matches,
76 const std::vector<ActionArg> &args);