Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yamingk committed Mar 7, 2024
1 parent a683f0d commit ab0b678
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,59 +11,74 @@ can_build_nonio_tests(build_nonio_tests)
if (${build_nonio_tests})
link_directories(${spdk_LIB_DIRS} ${dpdk_LIB_DIRS})

add_executable(test_raft_repl_dev)
target_sources(test_raft_repl_dev PRIVATE test_raft_repl_dev.cpp)
target_link_libraries(test_raft_repl_dev homestore ${COMMON_TEST_DEPS} GTest::gmock)
add_test(NAME RaftReplDev-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_raft_repl_dev)

# Ignoring sign-compare only for this test file because it uses folly concurrent_skip_list which violates this check.
set_source_files_properties(test_blkalloc.cpp PROPERTIES COMPILE_OPTIONS "-Wno-sign-compare" )
add_executable(test_blkalloc)
target_sources(test_blkalloc PRIVATE test_blkalloc.cpp $<TARGET_OBJECTS:hs_blkalloc>)
target_link_libraries(test_blkalloc homestore ${COMMON_TEST_DEPS} )
add_test(NAME BlkAlloc COMMAND ${CMAKE_BINARY_DIR}/bin/test_blkalloc)
SET_TESTS_PROPERTIES(BlkAlloc PROPERTIES DEPENDS RaftReplDev-Epoll)

add_executable(test_blk_cache_queue)
target_sources(test_blk_cache_queue PRIVATE test_blk_cache_queue.cpp ../lib/blkalloc/blk_cache_queue.cpp)
target_link_libraries(test_blk_cache_queue homestore ${COMMON_TEST_DEPS} )
add_test(NAME BlkCacheQueue COMMAND test_blk_cache_queue)
SET_TESTS_PROPERTIES(BlkCacheQueue PROPERTIES DEPENDS RaftReplDev-Epoll)

set(TEST_JOURNAL_VDEV_SOURCES test_journal_vdev.cpp)
add_executable(test_journal_vdev ${TEST_JOURNAL_VDEV_SOURCES})
target_link_libraries(test_journal_vdev homestore ${COMMON_TEST_DEPS} GTest::gmock)
add_test(NAME JournalVDev COMMAND ${CMAKE_BINARY_DIR}/bin/test_journal_vdev)
SET_TESTS_PROPERTIES(JournalVDev PROPERTIES DEPENDS RaftReplDev-Epoll)

set(TEST_BTREENODE_SOURCE_FILES test_btree_node.cpp)
add_executable(test_btree_node ${TEST_BTREENODE_SOURCE_FILES})
target_link_libraries(test_btree_node ${COMMON_TEST_DEPS} GTest::gtest)
add_test(NAME BtreeNode COMMAND test_btree_node)
SET_TESTS_PROPERTIES(BtreeNode PROPERTIES DEPENDS RaftReplDev-Epoll)

set(TEST_MEMBTREE_SOURCE_FILES test_mem_btree.cpp)
add_executable(test_mem_btree ${TEST_MEMBTREE_SOURCE_FILES})
target_link_libraries(test_mem_btree ${COMMON_TEST_DEPS} GTest::gtest)
add_test(NAME MemBtree COMMAND test_mem_btree)
set_tests_properties(MemBtree PROPERTIES TIMEOUT 1200)
SET_TESTS_PROPERTIES(MemBtree PROPERTIES DEPENDS RaftReplDev-Epoll)

add_executable(test_blk_read_tracker)
target_sources(test_blk_read_tracker PRIVATE test_blk_read_tracker.cpp ../lib/blkdata_svc/blk_read_tracker.cpp ../lib/blkalloc/blk.cpp)
target_link_libraries(test_blk_read_tracker ${COMMON_TEST_DEPS} GTest::gtest)
add_test(NAME BlkReadTracker COMMAND test_blk_read_tracker)
SET_TESTS_PROPERTIES(BlkReadTracker PROPERTIES DEPENDS RaftReplDev-Epoll)

set(TEST_PDEV_SOURCES test_pdev.cpp)
add_executable(test_physical_device ${TEST_PDEV_SOURCES})
target_link_libraries(test_physical_device homestore ${COMMON_TEST_DEPS} GTest::gmock)
add_test(NAME PhysicalDev COMMAND test_physical_device)
SET_TESTS_PROPERTIES(PhysicalDev PROPERTIES DEPENDS RaftReplDev-Epoll)

set(TEST_DEV_MGR_SOURCES test_device_manager.cpp)
add_executable(test_device_manager ${TEST_DEV_MGR_SOURCES})
target_link_libraries(test_device_manager homestore ${COMMON_TEST_DEPS} GTest::gmock)
add_test(NAME DeviceManager COMMAND test_device_manager)
SET_TESTS_PROPERTIES(DeviceManager PROPERTIES DEPENDS RaftReplDev-Epoll)

add_executable(test_append_blk_allocator)
target_sources(test_append_blk_allocator PRIVATE test_append_blkalloc.cpp)
target_link_libraries(test_append_blk_allocator homestore ${COMMON_TEST_DEPS} GTest::gmock)
add_test(NAME AppendBlkAlloc COMMAND test_append_blk_allocator)
set_property(TEST AppendBlkAlloc PROPERTY ENVIRONMENT "ASAN_OPTIONS=detect_stack_use_after_return=true")
SET_TESTS_PROPERTIES(AppendBlkAlloc PROPERTIES DEPENDS RaftReplDev-Epoll)

set(TEST_BLKID_SOURCES test_blkid.cpp ../lib/blkalloc/blk.cpp)
add_executable(test_blkid ${TEST_BLKID_SOURCES})
target_link_libraries(test_blkid ${COMMON_TEST_DEPS} GTest::gtest)
add_test(NAME TestBlkid COMMAND test_blkid)
SET_TESTS_PROPERTIES(TestBlkid PROPERTIES DEPENDS RaftReplDev-Epoll)

endif()

Expand All @@ -76,6 +91,7 @@ if (${io_tests})
add_test(NAME IndexBtree COMMAND test_index_btree --gtest_filter=*/0.*)
set_property(TEST IndexBtree PROPERTY ENVIRONMENT "ASAN_OPTIONS=detect_stack_use_after_return=true")
set_tests_properties(IndexBtree PROPERTIES TIMEOUT 1200)
SET_TESTS_PROPERTIES(IndexBtree PROPERTIES DEPENDS RaftReplDev-Epoll)

add_executable(test_data_service)
target_sources(test_data_service PRIVATE test_data_service.cpp)
Expand All @@ -93,6 +109,7 @@ if (${io_tests})
target_sources(test_cp_mgr PRIVATE test_cp_mgr.cpp)
target_link_libraries(test_cp_mgr homestore ${COMMON_TEST_DEPS} GTest::gtest)
add_test(NAME CPMgr COMMAND test_cp_mgr)
SET_TESTS_PROPERTIES(CPMgr PROPERTIES DEPENDS RaftReplDev-Epoll)

add_executable(test_solo_repl_dev)
target_sources(test_solo_repl_dev PRIVATE test_solo_repl_dev.cpp)
Expand All @@ -102,20 +119,18 @@ if (${io_tests})
target_sources(test_home_raft_logstore PRIVATE test_home_raft_logstore.cpp)
target_link_libraries(test_home_raft_logstore homestore ${COMMON_TEST_DEPS} GTest::gmock)

add_executable(test_raft_repl_dev)
target_sources(test_raft_repl_dev PRIVATE test_raft_repl_dev.cpp)
target_link_libraries(test_raft_repl_dev homestore ${COMMON_TEST_DEPS} GTest::gmock)

can_build_epoll_io_tests(epoll_tests)
if(${epoll_tests})
# add_test(NAME LogStore-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_log_store)
add_test(NAME MetaBlkMgr-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_meta_blk_mgr)
SET_TESTS_PROPERTIES(MetaBlkMgr-Epoll PROPERTIES DEPENDS RaftReplDev-Epoll)

add_test(NAME DataService-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_data_service)
SET_TESTS_PROPERTIES(DataService-Epoll PROPERTIES DEPENDS RaftReplDev-Epoll)

# add_test(NAME SoloReplDev-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_solo_repl_dev)
# add_test(NAME HomeRaftLogStore-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_home_raft_logstore)
add_test(NAME RaftReplDev-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_raft_repl_dev)
set_tests_properties(RaftReplDev-Epoll PROPERTIES DEPENDS "DataService-Epoll;MetaBlkMgr-Epoll;MemBtree;IndexBtree;CPMgr;JournalVDev;BlkReadTracker;PhysicalDev;DeviceManager;AppendBlkAlloc;BlkAlloc;BlkCacheQueue;BtreeNode")
# add_test(NAME RaftReplDev-Epoll COMMAND ${CMAKE_BINARY_DIR}/bin/test_raft_repl_dev)
endif()

can_build_spdk_io_tests(spdk_tests)
Expand Down

0 comments on commit ab0b678

Please sign in to comment.