7#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_LIB_TEST_BACKEND_H_
8#define BACKENDS_P4TOOLS_MODULES_TESTGEN_LIB_TEST_BACKEND_H_
15#include "backends/p4tools/common/lib/model.h"
16#include "backends/p4tools/common/lib/trace_event.h"
19#include "backends/p4tools/modules/testgen/core/program_info.h"
20#include "backends/p4tools/modules/testgen/core/symbolic_executor/symbolic_executor.h"
21#include "backends/p4tools/modules/testgen/lib/execution_state.h"
22#include "backends/p4tools/modules/testgen/lib/final_state.h"
23#include "backends/p4tools/modules/testgen/lib/test_framework.h"
24#include "backends/p4tools/modules/testgen/lib/test_spec.h"
25#include "backends/p4tools/modules/testgen/options.h"
27namespace P4::P4Tools::P4Testgen {
32 int64_t testCount = 0;
35 static const int64_t RESET_THRESHOLD = 10000;
38 std::reference_wrapper<const ProgramInfo> programInfo;
41 std::reference_wrapper<const TestBackendConfiguration> testBackendConfiguration;
60 explicit TestBackEnd(
const ProgramInfo &programInfo,
64 [[nodiscard]]
bool needsToTerminate(int64_t testCount)
const;
67 TestBackEnd(
const TestBackEnd &) =
default;
69 TestBackEnd(TestBackEnd &&) =
default;
71 TestBackEnd &operator=(
const TestBackEnd &) =
delete;
73 TestBackEnd &operator=(TestBackEnd &&) =
delete;
75 virtual ~TestBackEnd() =
default;
95 const std::vector<std::reference_wrapper<const TraceEvent>>
programTraces;
109 const IR::Expression *outputPortExpr);
119 const IR::Expression *outputPacketExpr,
const IR::Expression *outputPortExpr,
120 const std::vector<std::reference_wrapper<const TraceEvent>> *programTraces);