7#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_PNA_BACKEND_METADATA_METADATA_H_
8#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_PNA_BACKEND_METADATA_METADATA_H_
18#include <inja/inja.hpp>
21#include "lib/cstring.h"
23#include "backends/p4tools/modules/testgen/lib/test_framework.h"
24#include "backends/p4tools/modules/testgen/lib/test_spec.h"
31 std::ofstream metadataFile;
34 ~Metadata()
override =
default;
35 Metadata(
const Metadata &) =
delete;
36 Metadata(Metadata &&) =
delete;
37 Metadata &operator=(
const Metadata &) =
delete;
38 Metadata &operator=(Metadata &&) =
delete;
44 float currentCoverage)
override;
49 void emitPreamble(
const std::string &preamble);
56 void emitTestcase(
const TestSpec *testSpec,
cstring selectedBranches,
size_t testId,
57 const std::string &testCase,
float currentCoverage);
62 static void computeTraceData(
const TestSpec *testSpec, inja::json &dataJson);
65 static std::string getTestCaseTemplate();
68 static inja::json getSend(
const TestSpec *testSpec);
71 static inja::json getVerify(
const TestSpec *testSpec);
75 static std::vector<std::pair<size_t, size_t>> getIgnoreMasks(
const IR::Constant *mask);