From aac6385dc629c886e3095710e6b8cfd886dd18de Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 11 Sep 2021 18:09:15 +0200 Subject: [PATCH] build: Fixed unit tests on linux. Fuck cmake... --- tests/CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index fcbae7851..bef40e19a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16) -project(tests) +project(unit_tests) # Add new tests here # @@ -10,14 +10,16 @@ set(AVAILABLE_TESTS -add_executable(tests source/main.cpp ) -target_include_directories(tests PRIVATE include) -target_link_libraries(tests libimhex) -set_target_properties(tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) -add_custom_command(TARGET tests +add_executable(unit_tests source/main.cpp) +target_include_directories(unit_tests PRIVATE include) +target_link_libraries(unit_tests libimhex) + +set_target_properties(unit_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + +add_custom_command(TARGET unit_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/test_data" ${CMAKE_BINARY_DIR}) foreach (test IN LISTS AVAILABLE_TESTS) - add_test(NAME "${test}" COMMAND tests "${test}" WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + add_test(NAME "${test}" COMMAND unit_tests "${test}" WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) endforeach () \ No newline at end of file