From 17cd92f5192dfb2b497431b1501c81b9a9347334 Mon Sep 17 00:00:00 2001 From: fruffy Date: Wed, 1 Nov 2023 18:41:07 +0000 Subject: [PATCH] Flatten nesting of test backends and rename the folder appropriately. --- .../modules/testgen/targets/bmv2/CMakeLists.txt | 12 ++++++------ .../bmv2/test/{backend => test_backend}/ptf.cpp | 2 +- .../bmv2/test/{backend => test_backend}/ptf.h | 8 ++++---- .../bmv2/test/{backend => test_backend}/stf.cpp | 2 +- .../bmv2/test/{backend => test_backend}/stf.h | 8 ++++---- .../modules/testgen/targets/bmv2/test_backend.cpp | 8 ++++---- .../{backend/metadata => test_backend}/metadata.cpp | 2 +- .../{backend/metadata => test_backend}/metadata.h | 6 +++--- .../{backend/protobuf => test_backend}/protobuf.cpp | 2 +- .../{backend/protobuf => test_backend}/protobuf.h | 6 +++--- .../bmv2/{backend/ptf => test_backend}/ptf.cpp | 2 +- .../targets/bmv2/{backend/ptf => test_backend}/ptf.h | 6 +++--- .../bmv2/{backend/stf => test_backend}/stf.cpp | 2 +- .../targets/bmv2/{backend/stf => test_backend}/stf.h | 6 +++--- 14 files changed, 36 insertions(+), 36 deletions(-) rename backends/p4tools/modules/testgen/targets/bmv2/test/{backend => test_backend}/ptf.cpp (99%) rename backends/p4tools/modules/testgen/targets/bmv2/test/{backend => test_backend}/ptf.h (73%) rename backends/p4tools/modules/testgen/targets/bmv2/test/{backend => test_backend}/stf.cpp (99%) rename backends/p4tools/modules/testgen/targets/bmv2/test/{backend => test_backend}/stf.h (73%) rename backends/p4tools/modules/testgen/targets/bmv2/{backend/metadata => test_backend}/metadata.cpp (98%) rename backends/p4tools/modules/testgen/targets/bmv2/{backend/metadata => test_backend}/metadata.h (91%) rename backends/p4tools/modules/testgen/targets/bmv2/{backend/protobuf => test_backend}/protobuf.cpp (99%) rename backends/p4tools/modules/testgen/targets/bmv2/{backend/protobuf => test_backend}/protobuf.h (93%) rename backends/p4tools/modules/testgen/targets/bmv2/{backend/ptf => test_backend}/ptf.cpp (99%) rename backends/p4tools/modules/testgen/targets/bmv2/{backend/ptf => test_backend}/ptf.h (93%) rename backends/p4tools/modules/testgen/targets/bmv2/{backend/stf => test_backend}/stf.cpp (99%) rename backends/p4tools/modules/testgen/targets/bmv2/{backend/stf => test_backend}/stf.h (90%) diff --git a/backends/p4tools/modules/testgen/targets/bmv2/CMakeLists.txt b/backends/p4tools/modules/testgen/targets/bmv2/CMakeLists.txt index b1331b8cb9..92003a87ee 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/CMakeLists.txt +++ b/backends/p4tools/modules/testgen/targets/bmv2/CMakeLists.txt @@ -8,10 +8,10 @@ endif() set( TESTGEN_SOURCES ${TESTGEN_SOURCES} - ${CMAKE_CURRENT_SOURCE_DIR}/backend/protobuf/protobuf.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/backend/metadata/metadata.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/backend/ptf/ptf.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/backend/stf/stf.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_backend/protobuf.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_backend/metadata.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_backend/ptf.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test_backend/stf.cpp ${CMAKE_CURRENT_SOURCE_DIR}/bmv2.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cmd_stepper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/concolic.cpp @@ -32,8 +32,8 @@ set( set( TESTGEN_GTEST_SOURCES ${TESTGEN_GTEST_SOURCES} - ${CMAKE_CURRENT_SOURCE_DIR}/test/backend/ptf.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/test/backend/stf.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test/test_backend/ptf.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/test/test_backend/stf.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test/small-step/binary.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test/small-step/unary.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test/small-step/p4_asserts_parser_test.cpp diff --git a/backends/p4tools/modules/testgen/targets/bmv2/test/backend/ptf.cpp b/backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/ptf.cpp similarity index 99% rename from backends/p4tools/modules/testgen/targets/bmv2/test/backend/ptf.cpp rename to backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/ptf.cpp index ba18f06d7c..e183abbe2a 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/test/backend/ptf.cpp +++ b/backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/ptf.cpp @@ -1,4 +1,4 @@ -#include "backends/p4tools/modules/testgen/targets/bmv2/test/backend/ptf.h" +#include "backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/ptf.h" #include #include diff --git a/backends/p4tools/modules/testgen/targets/bmv2/test/backend/ptf.h b/backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/ptf.h similarity index 73% rename from backends/p4tools/modules/testgen/targets/bmv2/test/backend/ptf.h rename to backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/ptf.h index c5b8024544..7425ea3bef 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/test/backend/ptf.h +++ b/backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/ptf.h @@ -1,7 +1,7 @@ -#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_PTF_H_ -#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_PTF_H_ +#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_TEST_BACKEND_PTF_H_ +#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_TEST_BACKEND_PTF_H_ -#include "backends/p4tools/modules/testgen/targets/bmv2/backend/ptf/ptf.h" +#include "backends/p4tools/modules/testgen/targets/bmv2/test_backend/ptf.h" #include "backends/p4tools/modules/testgen/test/gtest_utils.h" namespace Test { @@ -29,4 +29,4 @@ class PTFTest : public P4ToolsTest { } // namespace Test -#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_PTF_H_ */ +#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_TEST_BACKEND_PTF_H_ */ diff --git a/backends/p4tools/modules/testgen/targets/bmv2/test/backend/stf.cpp b/backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/stf.cpp similarity index 99% rename from backends/p4tools/modules/testgen/targets/bmv2/test/backend/stf.cpp rename to backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/stf.cpp index 362ab5993f..8f4fb2ec6a 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/test/backend/stf.cpp +++ b/backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/stf.cpp @@ -1,4 +1,4 @@ -#include "backends/p4tools/modules/testgen/targets/bmv2/test/backend/stf.h" +#include "backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/stf.h" #include #include diff --git a/backends/p4tools/modules/testgen/targets/bmv2/test/backend/stf.h b/backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/stf.h similarity index 73% rename from backends/p4tools/modules/testgen/targets/bmv2/test/backend/stf.h rename to backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/stf.h index c4f0367174..afaaa15420 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/test/backend/stf.h +++ b/backends/p4tools/modules/testgen/targets/bmv2/test/test_backend/stf.h @@ -1,7 +1,7 @@ -#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_STF_H_ -#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_STF_H_ +#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_TEST_BACKEND_STF_H_ +#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_TEST_BACKEND_STF_H_ -#include "backends/p4tools/modules/testgen/targets/bmv2/backend/stf/stf.h" +#include "backends/p4tools/modules/testgen/targets/bmv2/test_backend/stf.h" #include "backends/p4tools/modules/testgen/test/gtest_utils.h" namespace Test { @@ -29,4 +29,4 @@ class STFTest : public P4ToolsTest { } // namespace Test -#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_STF_H_ */ +#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_TEST_BACKEND_STF_H_ */ diff --git a/backends/p4tools/modules/testgen/targets/bmv2/test_backend.cpp b/backends/p4tools/modules/testgen/targets/bmv2/test_backend.cpp index 31b9bc2a04..0f84ed1621 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/test_backend.cpp +++ b/backends/p4tools/modules/testgen/targets/bmv2/test_backend.cpp @@ -24,11 +24,11 @@ #include "backends/p4tools/modules/testgen/lib/test_backend.h" #include "backends/p4tools/modules/testgen/lib/test_object.h" #include "backends/p4tools/modules/testgen/options.h" -#include "backends/p4tools/modules/testgen/targets/bmv2/backend/metadata/metadata.h" -#include "backends/p4tools/modules/testgen/targets/bmv2/backend/protobuf/protobuf.h" -#include "backends/p4tools/modules/testgen/targets/bmv2/backend/ptf/ptf.h" -#include "backends/p4tools/modules/testgen/targets/bmv2/backend/stf/stf.h" #include "backends/p4tools/modules/testgen/targets/bmv2/program_info.h" +#include "backends/p4tools/modules/testgen/targets/bmv2/test_backend/metadata.h" +#include "backends/p4tools/modules/testgen/targets/bmv2/test_backend/protobuf.h" +#include "backends/p4tools/modules/testgen/targets/bmv2/test_backend/ptf.h" +#include "backends/p4tools/modules/testgen/targets/bmv2/test_backend/stf.h" #include "backends/p4tools/modules/testgen/targets/bmv2/test_spec.h" namespace P4Tools::P4Testgen::Bmv2 { diff --git a/backends/p4tools/modules/testgen/targets/bmv2/backend/metadata/metadata.cpp b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/metadata.cpp similarity index 98% rename from backends/p4tools/modules/testgen/targets/bmv2/backend/metadata/metadata.cpp rename to backends/p4tools/modules/testgen/targets/bmv2/test_backend/metadata.cpp index 69e618b03f..3be186f7f5 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/backend/metadata/metadata.cpp +++ b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/metadata.cpp @@ -1,4 +1,4 @@ -#include "backends/p4tools/modules/testgen/targets/bmv2/backend/metadata/metadata.h" +#include "backends/p4tools/modules/testgen/targets/bmv2/test_backend/metadata.h" #include #include diff --git a/backends/p4tools/modules/testgen/targets/bmv2/backend/metadata/metadata.h b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/metadata.h similarity index 91% rename from backends/p4tools/modules/testgen/targets/bmv2/backend/metadata/metadata.h rename to backends/p4tools/modules/testgen/targets/bmv2/test_backend/metadata.h index 142ffad319..1b8161d680 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/backend/metadata/metadata.h +++ b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/metadata.h @@ -1,5 +1,5 @@ -#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_BACKEND_METADATA_METADATA_H_ -#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_BACKEND_METADATA_METADATA_H_ +#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_METADATA_H_ +#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_METADATA_H_ #include #include @@ -75,4 +75,4 @@ class Metadata : public TF { } // namespace P4Tools::P4Testgen::Bmv2 -#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_BACKEND_METADATA_METADATA_H_ */ +#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_METADATA_H_ */ diff --git a/backends/p4tools/modules/testgen/targets/bmv2/backend/protobuf/protobuf.cpp b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/protobuf.cpp similarity index 99% rename from backends/p4tools/modules/testgen/targets/bmv2/backend/protobuf/protobuf.cpp rename to backends/p4tools/modules/testgen/targets/bmv2/test_backend/protobuf.cpp index 2296dc020c..dfab153828 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/backend/protobuf/protobuf.cpp +++ b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/protobuf.cpp @@ -1,4 +1,4 @@ -#include "backends/p4tools/modules/testgen/targets/bmv2/backend/protobuf/protobuf.h" +#include "backends/p4tools/modules/testgen/targets/bmv2/test_backend/protobuf.h" #include #include diff --git a/backends/p4tools/modules/testgen/targets/bmv2/backend/protobuf/protobuf.h b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/protobuf.h similarity index 93% rename from backends/p4tools/modules/testgen/targets/bmv2/backend/protobuf/protobuf.h rename to backends/p4tools/modules/testgen/targets/bmv2/test_backend/protobuf.h index 5d1e6b618d..eb7546ebf7 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/backend/protobuf/protobuf.h +++ b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/protobuf.h @@ -1,5 +1,5 @@ -#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_BACKEND_PROTOBUF_PROTOBUF_H_ -#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_BACKEND_PROTOBUF_PROTOBUF_H_ +#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_PROTOBUF_H_ +#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_PROTOBUF_H_ #include #include @@ -89,4 +89,4 @@ class Protobuf : public TF { } // namespace P4Tools::P4Testgen::Bmv2 -#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_BACKEND_PROTOBUF_PROTOBUF_H_ */ +#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_PROTOBUF_H_ */ diff --git a/backends/p4tools/modules/testgen/targets/bmv2/backend/ptf/ptf.cpp b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/ptf.cpp similarity index 99% rename from backends/p4tools/modules/testgen/targets/bmv2/backend/ptf/ptf.cpp rename to backends/p4tools/modules/testgen/targets/bmv2/test_backend/ptf.cpp index e03d727f55..8ccbe6a87f 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/backend/ptf/ptf.cpp +++ b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/ptf.cpp @@ -1,4 +1,4 @@ -#include "backends/p4tools/modules/testgen/targets/bmv2/backend/ptf/ptf.h" +#include "backends/p4tools/modules/testgen/targets/bmv2/test_backend/ptf.h" #include #include diff --git a/backends/p4tools/modules/testgen/targets/bmv2/backend/ptf/ptf.h b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/ptf.h similarity index 93% rename from backends/p4tools/modules/testgen/targets/bmv2/backend/ptf/ptf.h rename to backends/p4tools/modules/testgen/targets/bmv2/test_backend/ptf.h index 25b27f3bb6..bf0b63cf27 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/backend/ptf/ptf.h +++ b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/ptf.h @@ -1,5 +1,5 @@ -#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_BACKEND_PTF_PTF_H_ -#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_BACKEND_PTF_PTF_H_ +#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_PTF_H_ +#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_PTF_H_ #include #include @@ -88,4 +88,4 @@ class PTF : public TF { } // namespace P4Tools::P4Testgen::Bmv2 -#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_BACKEND_PTF_PTF_H_ */ +#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_PTF_H_ */ diff --git a/backends/p4tools/modules/testgen/targets/bmv2/backend/stf/stf.cpp b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/stf.cpp similarity index 99% rename from backends/p4tools/modules/testgen/targets/bmv2/backend/stf/stf.cpp rename to backends/p4tools/modules/testgen/targets/bmv2/test_backend/stf.cpp index 85794db9ee..eca5dc61a5 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/backend/stf/stf.cpp +++ b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/stf.cpp @@ -1,4 +1,4 @@ -#include "backends/p4tools/modules/testgen/targets/bmv2/backend/stf/stf.h" +#include "backends/p4tools/modules/testgen/targets/bmv2/test_backend/stf.h" #include #include diff --git a/backends/p4tools/modules/testgen/targets/bmv2/backend/stf/stf.h b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/stf.h similarity index 90% rename from backends/p4tools/modules/testgen/targets/bmv2/backend/stf/stf.h rename to backends/p4tools/modules/testgen/targets/bmv2/test_backend/stf.h index aab636a71f..35e5c12fe6 100644 --- a/backends/p4tools/modules/testgen/targets/bmv2/backend/stf/stf.h +++ b/backends/p4tools/modules/testgen/targets/bmv2/test_backend/stf.h @@ -1,5 +1,5 @@ -#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_BACKEND_STF_STF_H_ -#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_BACKEND_STF_STF_H_ +#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_STF_H_ +#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_STF_H_ #include #include @@ -68,4 +68,4 @@ class STF : public TF { } // namespace P4Tools::P4Testgen::Bmv2 -#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_BACKEND_STF_STF_H_ */ +#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_BACKEND_STF_H_ */