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
luwenpeng e62ea7e9f9 增加测试用例
raw_pkt_mirr_block
    raw_pkt_mirr_bypass
    raw_pkt_mirr_forward
    raw_pkt_error_bypass
    raw_pkt_mirr_rx_drop
    raw_pkt_stee_rx_egress
2023-04-07 18:54:53 +08:00

147 lines
7.7 KiB
CMake

###############################################################################
# gmock_marsio
###############################################################################
add_library(gmock_marsio marsio.cpp)
target_include_directories(gmock_marsio PUBLIC ${CMAKE_CURRENT_LIST_DIR})
###############################################################################
# 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 MESA_field_stat 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_raw_pkt_stee_bypass
###############################################################################
add_executable(gtest_raw_pkt_stee_bypass gtest_raw_pkt_stee_bypass.cpp)
target_include_directories(gtest_raw_pkt_stee_bypass PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_raw_pkt_stee_bypass PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_raw_pkt_stee_bypass temp_platform gtest)
###############################################################################
# gtest_raw_pkt_stee_block
###############################################################################
add_executable(gtest_raw_pkt_stee_block gtest_raw_pkt_stee_block.cpp)
target_include_directories(gtest_raw_pkt_stee_block PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_raw_pkt_stee_block PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_raw_pkt_stee_block temp_platform gtest)
###############################################################################
# gtest_raw_pkt_stee_forward
###############################################################################
add_executable(gtest_raw_pkt_stee_forward gtest_raw_pkt_stee_forward.cpp)
target_include_directories(gtest_raw_pkt_stee_forward PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_raw_pkt_stee_forward PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_raw_pkt_stee_forward temp_platform gtest)
###############################################################################
# gtest_raw_pkt_stee_rx_egress
###############################################################################
add_executable(gtest_raw_pkt_stee_rx_egress gtest_raw_pkt_stee_rx_egress.cpp)
target_include_directories(gtest_raw_pkt_stee_rx_egress PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_raw_pkt_stee_rx_egress PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_raw_pkt_stee_rx_egress temp_platform gtest)
###############################################################################
# gtest_raw_pkt_mirr_bypass
###############################################################################
add_executable(gtest_raw_pkt_mirr_bypass gtest_raw_pkt_mirr_bypass.cpp)
target_include_directories(gtest_raw_pkt_mirr_bypass PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_raw_pkt_mirr_bypass PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_raw_pkt_mirr_bypass temp_platform gtest)
###############################################################################
# gtest_raw_pkt_mirr_block
###############################################################################
add_executable(gtest_raw_pkt_mirr_block gtest_raw_pkt_mirr_block.cpp)
target_include_directories(gtest_raw_pkt_mirr_block PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_raw_pkt_mirr_block PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_raw_pkt_mirr_block temp_platform gtest)
###############################################################################
# gtest_raw_pkt_mirr_forward
###############################################################################
add_executable(gtest_raw_pkt_mirr_forward gtest_raw_pkt_mirr_forward.cpp)
target_include_directories(gtest_raw_pkt_mirr_forward PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_raw_pkt_mirr_forward PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_raw_pkt_mirr_forward temp_platform gtest)
###############################################################################
# gtest_raw_pkt_mirr_rx_drop
###############################################################################
add_executable(gtest_raw_pkt_mirr_rx_drop gtest_raw_pkt_mirr_rx_drop.cpp)
target_include_directories(gtest_raw_pkt_mirr_rx_drop PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_raw_pkt_mirr_rx_drop PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_raw_pkt_mirr_rx_drop temp_platform gtest)
###############################################################################
# gtest_raw_pkt_error_bypass
###############################################################################
add_executable(gtest_raw_pkt_error_bypass gtest_raw_pkt_error_bypass.cpp)
target_include_directories(gtest_raw_pkt_error_bypass PUBLIC ${CMAKE_SOURCE_DIR}/common/include)
target_include_directories(gtest_raw_pkt_error_bypass PUBLIC ${CMAKE_SOURCE_DIR}/platform/include)
target_link_libraries(gtest_raw_pkt_error_bypass 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_raw_pkt_stee_bypass)
gtest_discover_tests(gtest_raw_pkt_stee_block)
gtest_discover_tests(gtest_raw_pkt_stee_forward)
gtest_discover_tests(gtest_raw_pkt_stee_rx_egress)
gtest_discover_tests(gtest_raw_pkt_mirr_bypass)
gtest_discover_tests(gtest_raw_pkt_mirr_block)
gtest_discover_tests(gtest_raw_pkt_mirr_forward)
gtest_discover_tests(gtest_raw_pkt_mirr_rx_drop)
gtest_discover_tests(gtest_raw_pkt_error_bypass)
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/)