Attempt to fix test-build on travis

This commit is contained in:
Linus Probert 2017-12-13 12:18:20 +01:00
parent b5ddc344c4
commit f90a7c735e
3 changed files with 6 additions and 3 deletions

View File

@ -58,8 +58,9 @@ target_link_libraries(breakhack
# TESTS:
IF (CHECK_FOUND)
find_package(Threads REQUIRED)
enable_testing()
add_executable(test_util test/check_util src/util)
target_link_libraries(test_util ${CHECK_LIBRARIES})
target_link_libraries(test_util ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
add_test(test_util test_util)
ENDIF (CHECK_FOUND)

View File

@ -13,9 +13,10 @@ add_library(hashtable hashtable.c)
include_directories(${CHECK_INCLUDE_DIR})
if (CHECK_FOUND)
find_package(Threads REQUIRED)
enable_testing()
add_executable(test_table check_hashtable hashtable)
target_compile_options(test_table PRIVATE -pthread)
target_link_libraries(test_table ${CHECK_LIBRARIES})
target_link_libraries(test_table ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
add_test(test_table test_table)
endif (CHECK_FOUND)

View File

@ -13,9 +13,10 @@ add_library(linkedlist linkedlist.c)
include_directories(${CHECK_INCLUDE_DIR})
if (CHECK_FOUND)
find_package(Threads REQUIRED)
enable_testing()
add_executable(test_list check_linkedlist linkedlist)
target_compile_options(test_list PRIVATE -pthread)
target_link_libraries(test_list ${CHECK_LIBRARIES})
target_link_libraries(test_list ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
add_test(test_list test_list)
endif (CHECK_FOUND)