Skip to content

Commit

Permalink
Add vineyard_llm_cache_tests target and don't install tests artifacts…
Browse files Browse the repository at this point in the history
… in ALL (#1790)

Signed-off-by: Tao He <[email protected]>
  • Loading branch information
sighingnow authored Mar 1, 2024
1 parent 82149ce commit 3e4738f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 deletions.
25 changes: 24 additions & 1 deletion modules/llm-cache/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,27 @@ target_link_libraries(vineyard_llm_cache PUBLIC vineyard_client vineyard_basic)
install_export_vineyard_target(vineyard_llm_cache)
install_vineyard_headers("${CMAKE_CURRENT_SOURCE_DIR}")

add_subdirectory(tests)
add_custom_target(vineyard_llm_cache_tests)
add_dependencies(vineyard_tests vineyard_llm_cache_tests)

if(BUILD_VINEYARD_TESTS)
enable_testing()
file(GLOB TEST_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/tests" "${CMAKE_CURRENT_SOURCE_DIR}/tests/*.cc")
foreach(f ${TEST_FILES})
string(REGEX MATCH "^(.*)\\.[^.]*$" dummy ${f})
set(T_NAME ${CMAKE_MATCH_1})
message(STATUS "Found unit_test - " ${T_NAME})
if(BUILD_VINEYARD_TESTS_ALL)
add_executable(${T_NAME} tests/${T_NAME}.cc)
else()
add_executable(${T_NAME} EXCLUDE_FROM_ALL tests/${T_NAME}.cc)
endif()
target_link_libraries(${T_NAME} PRIVATE
vineyard_llm_cache)
if(${LIBUNWIND_FOUND})
target_link_libraries(${T_NAME} PRIVATE ${LIBUNWIND_LIBRARIES})
endif()
add_test(${T_NAME}, ${T_NAME})
add_dependencies(vineyard_llm_cache_tests ${T_NAME})
endforeach()
endif()
26 changes: 0 additions & 26 deletions modules/llm-cache/tests/CMakeLists.txt

This file was deleted.

0 comments on commit 3e4738f

Please sign in to comment.