diff --git a/CMakeLists.txt b/CMakeLists.txt index 71a77794..938d914a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,3 +7,4 @@ set(VITASTOR_VERSION "2.4.4") include(CTest) add_subdirectory(src) +add_dependencies(test build_tests) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index f741647b..c2a05aff 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -36,6 +36,7 @@ add_test(NAME test_allocator COMMAND test_allocator) # test_heap add_executable(test_heap + EXCLUDE_FROM_ALL test_heap.cpp ../blockstore/multilist.cpp ../blockstore/blockstore_heap.cpp @@ -44,6 +45,7 @@ add_executable(test_heap ../blockstore/blockstore_disk.cpp ../util/str_util.cpp ) +add_dependencies(build_tests test_heap) add_test(NAME test_heap COMMAND test_heap) target_compile_options(test_heap PRIVATE -coverage) target_link_options(test_heap PRIVATE -coverage) @@ -65,7 +67,8 @@ target_link_libraries(test_crc32 ) # test_blockstore -add_executable(test_blockstore test_blockstore.cpp ringloop_mock.cpp) +add_executable(test_blockstore EXCLUDE_FROM_ALL test_blockstore.cpp ringloop_mock.cpp) +add_dependencies(build_tests test_blockstore) target_link_libraries(test_blockstore vitastor_blk) add_test(NAME test_blockstore COMMAND test_blockstore)