Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[P4Testgen] Flatten nesting of BMv2 test back ends and rename the folder appropriately. #4219

Merged
merged 1 commit into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions backends/p4tools/modules/testgen/targets/bmv2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I think I'd go with just 'backend' here instead of test_backend? But not very important if you have a preference.

${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
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <gmock/gmock-matchers.h>
#include <gtest/gtest-message.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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_ */
Original file line number Diff line number Diff line change
@@ -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 <gmock/gmock-matchers.h>
#include <gtest/gtest-message.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down Expand Up @@ -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_ */
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <algorithm>
#include <functional>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <cstddef>
#include <filesystem>
Expand Down Expand Up @@ -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_ */
Original file line number Diff line number Diff line change
@@ -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 <algorithm>
#include <filesystem>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <cstddef>
#include <filesystem>
Expand Down Expand Up @@ -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_ */
Original file line number Diff line number Diff line change
@@ -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 <algorithm>
#include <filesystem>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <cstddef>
#include <filesystem>
Expand Down Expand Up @@ -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_ */
Original file line number Diff line number Diff line change
@@ -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 <fstream>
#include <iomanip>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <cstddef>
#include <filesystem>
Expand Down Expand Up @@ -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_ */
Loading