X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=test%2FCMakeLists.txt;h=e2ecf0a27a2b1aa283a423a78c4999518db98d8b;hb=f9c4c047caf6847f06e8059e11aff90e1ccdd84b;hp=ebb39afe84a755f11b8da79f8ca69ac91b1f7f2d;hpb=96fce03b6aeece751471d10af766e1a195701b45;p=awesomized%2Flibmemcached diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ebb39afe..e2ecf0a2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,14 +2,26 @@ if(NOT BUILD_TESTING OR NOT CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) return() endif() -include(CMake/Catch.cmake) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake") +include(Catch) +include(CheckTbb) + +if(NOT MEMCACHED_BINARY) + message(SEND_ERROR "Could not find memcached(1) binary") + set(ENV{INVALID_CONFIGURATION} 1) +endif() check_decl(pipe2 unistd.h) check_decl(SOCK_NONBLOCK sys/socket.h) check_decl(SOCK_CLOEXEC sys/socket.h) +check_decl(waitid sys/wait.h) +if(HAVE_WAITID) + check_compiles(HAVE_WAITID_NOWAIT "siginfo_t s; waitid(P_ALL, 0, &s, WNOWAIT|WEXITED);" sys/types.h sys/wait.h) +endif() file(GLOB_RECURSE TESTING_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) set(TESTING_ROOT ${CMAKE_CURRENT_BINARY_DIR}) +set(SOURCES_ROOT ${CMAKE_SOURCE_DIR}) set_source_files_properties(main.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) configure_file(conf.h.in conf.h @ONLY) add_executable(runtests ${TESTING_SRC}) @@ -20,7 +32,16 @@ target_include_directories(runtests PRIVATE ${CMAKE_SOURCE_DIR}/src ${CMAKE_BINARY_DIR}/src) target_link_libraries(runtests PRIVATE libhashkit libmemcachedinternal libmemcachedutil) + +check_tbb() +if(HAVE_TBB) + target_link_libraries(runtests PRIVATE ${LIBTBB}) +endif() + add_dependencies(runtests ${CLIENTS}) +if(HAVE_MEMASLAP) + add_dependencies(runtests memaslap) +endif() catch_discover_tests(runtests TEST_SPEC "lib*")