From ab0b6788e5dd809eca5e456e602548c3bbd00855 Mon Sep 17 00:00:00 2001 From: Yaming Kuang Date: Thu, 7 Mar 2024 14:28:34 -0700 Subject: [PATCH] fix --- src/tests/CMakeLists.txt | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 53f84b8ee..e3bf4dec4 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -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_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() @@ -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) @@ -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) @@ -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)