1#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_PNA_BACKEND_METADATA_METADATA_H_
2#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_PNA_BACKEND_METADATA_METADATA_H_
12#include <inja/inja.hpp>
15#include "lib/cstring.h"
17#include "backends/p4tools/modules/testgen/lib/test_framework.h"
18#include "backends/p4tools/modules/testgen/lib/test_spec.h"
25 std::ofstream metadataFile;
28 ~Metadata()
override =
default;
29 Metadata(
const Metadata &) =
delete;
30 Metadata(Metadata &&) =
delete;
31 Metadata &operator=(
const Metadata &) =
delete;
32 Metadata &operator=(Metadata &&) =
delete;
38 float currentCoverage)
override;
43 void emitPreamble(
const std::string &preamble);
50 void emitTestcase(
const TestSpec *testSpec,
cstring selectedBranches,
size_t testId,
51 const std::string &testCase,
float currentCoverage);
56 static void computeTraceData(
const TestSpec *testSpec, inja::json &dataJson);
59 static std::string getTestCaseTemplate();
62 static inja::json getSend(
const TestSpec *testSpec);
65 static inja::json getVerify(
const TestSpec *testSpec);
69 static std::vector<std::pair<size_t, size_t>> getIgnoreMasks(
const IR::Constant *mask);