Skip to content

Commit

Permalink
[P4Testgen] Allow building p4testgen without BMV2 target (#4109)
Browse files Browse the repository at this point in the history
* Allow building testgen with targets that don't have include path dependencies
* Move BMV2-using testgen test to BVM2 folder
* Also move tests that fail without BVM2 to BVM2
  • Loading branch information
vlstill authored Aug 15, 2023
1 parent 2820a3c commit 38952df
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 9 deletions.
12 changes: 3 additions & 9 deletions backends/p4tools/modules/testgen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ set(
test/gtest_utils.cpp
test/lib/format_int.cpp
test/lib/taint.cpp
test/small-step/binary.cpp
test/small-step/reachability.cpp
test/small-step/unary.cpp
test/small-step/util.cpp
test/small-step/value.cpp
test/small-step/p4_asserts_parser_test.cpp
test/transformations/saturation_arithm.cpp
test/z3-solver/asrt_model.cpp
test/z3-solver/expressions.cpp
)

# Inja is needed to produce test templates.
Expand Down Expand Up @@ -112,7 +104,9 @@ configure_file(register.h.in register.h)
add_p4tools_library(testgen ${TESTGEN_SOURCES})
# Make sure the testgen library and anything that links to it see both the Z3 and Inja includes.
target_link_libraries(testgen PUBLIC p4tools-common inja)
target_include_directories(testgen ${TESTGEN_INCLUDES})
if (TESTGEN_INCLUDES)
target_include_directories(testgen ${TESTGEN_INCLUDES})
endif()

# The executable.
add_p4tools_executable(p4testgen main.cpp)
Expand Down
8 changes: 8 additions & 0 deletions backends/p4tools/modules/testgen/targets/bmv2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ set(
${TESTGEN_GTEST_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/test/backend/ptf.cpp
${CMAKE_CURRENT_SOURCE_DIR}/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
${CMAKE_CURRENT_SOURCE_DIR}/test/small-step/value.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test/small-step/reachability.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test/transformations/saturation_arithm.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test/z3-solver/expressions.cpp
${CMAKE_CURRENT_SOURCE_DIR}/test/z3-solver/asrt_model.cpp
PARENT_SCOPE
)

Expand Down

0 comments on commit 38952df

Please sign in to comment.