Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
beats-dh committed Sep 12, 2023
1 parent 084fb62 commit 6222c5a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ enable_testing()
function(setup_test TARGET_NAME DIR)
add_executable(${TARGET_NAME} main.cpp)

include(RustLib)

target_compile_definitions(${TARGET_NAME} PUBLIC -DDEBUG_LOG)
target_link_libraries(${TARGET_NAME} PRIVATE Boost::ut ${PROJECT_NAME}_lib)
target_link_libraries(${TARGET_NAME} PRIVATE Boost::ut ${PROJECT_NAME}_lib)
target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/tests/fixture PRIVATE ${CMAKE_SOURCE_DIR}/tests/${DIR})
target_link_libraries(${TARGET_NAME} PRIVATE ${RUST_LIB_FULL_PATH})

add_test(NAME ${DIR} COMMAND ${TARGET_NAME})
if(RUN_TESTS_AFTER_BUILD)
if (RUN_TESTS_AFTER_BUILD)
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND ${CMAKE_CTEST_COMMAND} --verbose
Expand All @@ -21,4 +24,4 @@ function(setup_test TARGET_NAME DIR)
endfunction()

add_subdirectory(unit)
add_subdirectory(integration)
add_subdirectory(integration)

0 comments on commit 6222c5a

Please sign in to comment.