This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
tango-tsg-service-chaining-…/test/CMakeLists.txt
2024-11-12 16:58:19 +08:00

173 lines
9.1 KiB
CMake

###############################################################################
# gmock_marsio
###############################################################################
add_library(gmock_marsio gmock_marsio.cpp)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
target_include_directories(gmock_marsio PUBLIC /opt/tsg/mrzcpd/corei7/include)
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
target_include_directories(gmock_marsio PUBLIC /opt/tsg/mrzcpd/aarch64/include)
endif()
###############################################################################
# temp_platform
###############################################################################
add_library(temp_platform
${CMAKE_SOURCE_DIR}/platform/src/policy.cpp
${CMAKE_SOURCE_DIR}/platform/src/health_check.cpp
${CMAKE_SOURCE_DIR}/platform/src/sce.cpp
${CMAKE_SOURCE_DIR}/platform/src/packet_io.cpp
${CMAKE_SOURCE_DIR}/platform/src/global_metrics.cpp
${CMAKE_SOURCE_DIR}/platform/src/sf_metrics.cpp
${CMAKE_SOURCE_DIR}/platform/src/sf_status.cpp)
target_include_directories(temp_platform PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(temp_platform PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(temp_platform PUBLIC common pthread cjson maatframe MESA_prof_load fieldstat4 gmock_marsio)
###############################################################################
# gtest_ctrl_pkt_opening
###############################################################################
add_executable(gtest_ctrl_pkt_opening gtest_ctrl_pkt_opening.cpp)
target_include_directories(gtest_ctrl_pkt_opening PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_ctrl_pkt_opening PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_ctrl_pkt_opening temp_platform gtest)
###############################################################################
# gtest_ctrl_pkt_active
###############################################################################
add_executable(gtest_ctrl_pkt_active gtest_ctrl_pkt_active.cpp)
target_include_directories(gtest_ctrl_pkt_active PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_ctrl_pkt_active PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_ctrl_pkt_active temp_platform gtest)
###############################################################################
# gtest_data_pkt_stee_bypass
###############################################################################
add_executable(gtest_data_pkt_stee_bypass gtest_data_pkt_stee_bypass.cpp)
target_include_directories(gtest_data_pkt_stee_bypass PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_stee_bypass PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_stee_bypass temp_platform gtest)
###############################################################################
# gtest_data_pkt_stee_block
###############################################################################
add_executable(gtest_data_pkt_stee_block gtest_data_pkt_stee_block.cpp)
target_include_directories(gtest_data_pkt_stee_block PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_stee_block PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_stee_block temp_platform gtest)
###############################################################################
# gtest_data_pkt_stee_forward
###############################################################################
add_executable(gtest_data_pkt_stee_forward gtest_data_pkt_stee_forward.cpp)
target_include_directories(gtest_data_pkt_stee_forward PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_stee_forward PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_stee_forward temp_platform gtest)
###############################################################################
# gtest_data_pkt_stee_rx_egress
###############################################################################
add_executable(gtest_data_pkt_stee_rx_egress gtest_data_pkt_stee_rx_egress.cpp)
target_include_directories(gtest_data_pkt_stee_rx_egress PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_stee_rx_egress PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_stee_rx_egress temp_platform gtest)
###############################################################################
# gtest_data_pkt_mirr_bypass
###############################################################################
add_executable(gtest_data_pkt_mirr_bypass gtest_data_pkt_mirr_bypass.cpp)
target_include_directories(gtest_data_pkt_mirr_bypass PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_mirr_bypass PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_mirr_bypass temp_platform gtest)
###############################################################################
# gtest_data_pkt_mirr_block
###############################################################################
add_executable(gtest_data_pkt_mirr_block gtest_data_pkt_mirr_block.cpp)
target_include_directories(gtest_data_pkt_mirr_block PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_mirr_block PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_mirr_block temp_platform gtest)
###############################################################################
# gtest_data_pkt_mirr_forward
###############################################################################
add_executable(gtest_data_pkt_mirr_forward gtest_data_pkt_mirr_forward.cpp)
target_include_directories(gtest_data_pkt_mirr_forward PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_mirr_forward PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_mirr_forward temp_platform gtest)
###############################################################################
# gtest_data_pkt_mirr_rx_drop
###############################################################################
add_executable(gtest_data_pkt_mirr_rx_drop gtest_data_pkt_mirr_rx_drop.cpp)
target_include_directories(gtest_data_pkt_mirr_rx_drop PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_mirr_rx_drop PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_mirr_rx_drop temp_platform gtest)
###############################################################################
# gtest_data_pkt_error_bypass
###############################################################################
add_executable(gtest_data_pkt_error_bypass gtest_data_pkt_error_bypass.cpp)
target_include_directories(gtest_data_pkt_error_bypass PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_data_pkt_error_bypass PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_data_pkt_error_bypass temp_platform gtest)
###############################################################################
# gtest_mix_pkt_stee_forward
###############################################################################
add_executable(gtest_mix_pkt_stee_forward gtest_mix_pkt_stee_forward.cpp)
target_include_directories(gtest_mix_pkt_stee_forward PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_mix_pkt_stee_forward PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_mix_pkt_stee_forward temp_platform gtest)
###############################################################################
# gtest_vlan_encapsulate
###############################################################################
add_executable(gtest_vlan_encapsulate gtest_vlan_encapsulate.cpp)
target_include_directories(gtest_vlan_encapsulate PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_vlan_encapsulate PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_vlan_encapsulate temp_platform gtest)
###############################################################################
# gtest_discover_tests
###############################################################################
include(GoogleTest)
gtest_discover_tests(gtest_ctrl_pkt_opening)
gtest_discover_tests(gtest_ctrl_pkt_active)
gtest_discover_tests(gtest_data_pkt_stee_bypass)
gtest_discover_tests(gtest_data_pkt_stee_block)
gtest_discover_tests(gtest_data_pkt_stee_forward)
gtest_discover_tests(gtest_data_pkt_stee_rx_egress)
gtest_discover_tests(gtest_data_pkt_mirr_bypass)
gtest_discover_tests(gtest_data_pkt_mirr_block)
gtest_discover_tests(gtest_data_pkt_mirr_forward)
gtest_discover_tests(gtest_data_pkt_mirr_rx_drop)
gtest_discover_tests(gtest_data_pkt_error_bypass)
gtest_discover_tests(gtest_mix_pkt_stee_forward)
gtest_discover_tests(gtest_vlan_encapsulate)
file(COPY ./test_data/log/ DESTINATION ./log/)
file(COPY ./test_data/conf/ DESTINATION ./conf/)
file(COPY ./test_data/resource/ DESTINATION ./resource/)
file(COPY ${CMAKE_SOURCE_DIR}/resource/table_info.conf DESTINATION ./resource/)