You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
809 B
31 lines
809 B
cmake_minimum_required(VERSION 3.20) |
|
|
|
enable_testing() |
|
|
|
find_package(Catch2 CONFIG REQUIRED) |
|
|
|
# Macro to create a test executable |
|
function(add_integration_test TEST_NAME SOURCE_FILE) |
|
add_executable(${TEST_NAME} |
|
${SOURCE_FILE} |
|
) |
|
|
|
target_link_libraries(${TEST_NAME} |
|
PRIVATE |
|
AutoStoreLib |
|
Catch2::Catch2WithMain |
|
) |
|
|
|
target_include_directories(${TEST_NAME} |
|
PRIVATE |
|
${PROJECT_SOURCE_DIR}/lib/include |
|
${PROJECT_SOURCE_DIR}/lib/src |
|
) |
|
|
|
# Add test to CTest |
|
add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME}) |
|
endfunction() |
|
|
|
# Create test executables |
|
add_integration_test(FileUserRepositoryTest integration/FileUserRepository.test.cpp) |
|
add_integration_test(FileItemRepositoryTest integration/FileItemRepository.test.cpp) |