added a way to find test data wihout copy

This commit is contained in:
Erik Frojdh
2024-03-14 10:14:34 +01:00
parent 954db79c36
commit 5f8d8a8c0b
4 changed files with 42 additions and 12 deletions

View File

@ -17,15 +17,21 @@ set_target_properties(tests PROPERTIES
include(CTest)
include(Catch)
catch_discover_tests(tests)
if(AARE_TESTS)
set(TestSources
${CMAKE_CURRENT_SOURCE_DIR}/test.cpp
)
target_sources(tests PRIVATE ${TestSources} )
set(TestSources
${CMAKE_CURRENT_SOURCE_DIR}/test.cpp
)
target_sources(tests PRIVATE ${TestSources} )
#Work around to remove, this is not the way to do it =)
# target_include_directories(tests PRIVATE ${CMAKE_SOURCE_DIR}/include/common)
target_link_libraries(tests PRIVATE core aare_compiler_flags)
endif()
#Work around to remove, this is not the way to do it =)
# target_include_directories(tests PRIVATE ${CMAKE_SOURCE_DIR}/include/common)
target_link_libraries(tests PRIVATE core aare_compiler_flags)
catch_discover_tests(tests
# WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/data
)
#configure a header to pass test file paths
get_filename_component(TEST_FILE_PATH ${PROJECT_SOURCE_DIR}/data ABSOLUTE)
configure_file(test_config.hpp.in test_config.hpp)
target_include_directories(tests PRIVATE ${CMAKE_CURRENT_BINARY_DIR})