From 14fcd34ccbbfdacc4eb28e66dc1a54e31339415d Mon Sep 17 00:00:00 2001 From: Yao Yue Date: Mon, 22 Jul 2019 19:27:56 -0700 Subject: [PATCH] fix check related config --- CMakeLists.txt | 15 +++++++++------ test/CMakeLists.txt | 2 -- test/data_structure/bitmap/CMakeLists.txt | 1 - test/data_structure/intarray/CMakeLists.txt | 1 - test/data_structure/intarray/check_intarray.c | 7 ++++--- test/data_structure/ziplist/CMakeLists.txt | 1 - test/datapool/CMakeLists.txt | 1 - test/hotkey/kc_map/CMakeLists.txt | 1 - test/hotkey/key_window/CMakeLists.txt | 1 - test/protocol/admin/CMakeLists.txt | 1 - test/protocol/data/memcache/CMakeLists.txt | 1 - test/protocol/data/redis/CMakeLists.txt | 1 - test/storage/cuckoo/CMakeLists.txt | 1 - test/storage/slab/CMakeLists.txt | 2 +- test/time/CMakeLists.txt | 2 +- 15 files changed, 15 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6aecfd759..ef52b245c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,6 +116,12 @@ if(BUILD_AND_INSTALL_CHECK) set(CMAKE_REQUIRED_LIBRARIES "${CHECK_ROOT_DIR}/lib") endif() +if(NOT CHECK_FOUND) + find_package(Check QUIET 0.10) +endif() + + + if(${OS_PLATFORM} MATCHES "OS_LINUX") set(CFLAGS_LIST "${CFLAGS_LIST} -lrt") endif() @@ -146,10 +152,6 @@ if(PKG_CONFIG_FOUND) pkg_check_modules(CHECK QUIET check>=0.10) endif() -if(NOT CHECK_FOUND) - find_package(Check QUIET 0.10) -endif() - if (USE_PMEM) if(PKG_CONFIG_FOUND) pkg_check_modules(LIBPMEM REQUIRED libpmem>=1.0) @@ -179,11 +181,12 @@ add_subdirectory(src) # tests: always build last if(CHECK_FOUND) - include_directories(${include_directories} ${CHECK_INCLUDES}) + include_directories(${CHECK_INCLUDE_DIRS}) + link_directories(${CHECK_LIBRARY_DIRS}) add_subdirectory(test) endif(CHECK_FOUND) -add_subdirectory(benchmarks) +# add_subdirectory(benchmarks) # print a summary diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ecc5257af..fe76bd74d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,7 +1,5 @@ include_directories(${include_directories} CHECK_INCLUDES) -add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND}) - add_subdirectory(data_structure) add_subdirectory(protocol) add_subdirectory(hotkey) diff --git a/test/data_structure/bitmap/CMakeLists.txt b/test/data_structure/bitmap/CMakeLists.txt index 65dee8fa2..7848f7c3f 100644 --- a/test/data_structure/bitmap/CMakeLists.txt +++ b/test/data_structure/bitmap/CMakeLists.txt @@ -8,5 +8,4 @@ target_link_libraries(${test_name} ds_${suite}) target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES}) target_link_libraries(${test_name} pthread m) -add_dependencies(check ${test_name}) add_test(${test_name} ${test_name}) diff --git a/test/data_structure/intarray/CMakeLists.txt b/test/data_structure/intarray/CMakeLists.txt index 45353e35f..f67cc8045 100644 --- a/test/data_structure/intarray/CMakeLists.txt +++ b/test/data_structure/intarray/CMakeLists.txt @@ -7,5 +7,4 @@ add_executable(${test_name} ${source}) target_link_libraries(${test_name} ds_${suite}) target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} pthread m) -add_dependencies(check ${test_name}) add_test(${test_name} ${test_name}) diff --git a/test/data_structure/intarray/check_intarray.c b/test/data_structure/intarray/check_intarray.c index 38f4dc639..36e116192 100644 --- a/test/data_structure/intarray/check_intarray.c +++ b/test/data_structure/intarray/check_intarray.c @@ -1,7 +1,8 @@ -#include +#include #include #include +#include #include @@ -12,7 +13,7 @@ #define BUF_SIZE 8200 #define NENTRY 1024 -static char buf[BUF_SIZE]; +static unsigned char buf[BUF_SIZE]; /* @@ -42,7 +43,7 @@ intarray_suite(void) TCase *tc_intarray = tcase_create("intarray"); suite_add_tcase(s, tc_intarray); - tcase_add_test(tc_zipentry, test_intarray_create); + tcase_add_test(tc_intarray, test_intarray_create); return s; } diff --git a/test/data_structure/ziplist/CMakeLists.txt b/test/data_structure/ziplist/CMakeLists.txt index 225664269..9997aa4a3 100644 --- a/test/data_structure/ziplist/CMakeLists.txt +++ b/test/data_structure/ziplist/CMakeLists.txt @@ -7,5 +7,4 @@ add_executable(${test_name} ${source}) target_link_libraries(${test_name} ds_${suite}) target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} pthread m) -add_dependencies(check ${test_name}) add_test(${test_name} ${test_name}) diff --git a/test/datapool/CMakeLists.txt b/test/datapool/CMakeLists.txt index 2d8d65efa..335a93505 100644 --- a/test/datapool/CMakeLists.txt +++ b/test/datapool/CMakeLists.txt @@ -8,5 +8,4 @@ target_link_libraries(${test_name} ${suite}) target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES}) target_link_libraries(${test_name} datapool) -add_dependencies(check ${test_name}) add_test(${test_name} ${test_name}) diff --git a/test/hotkey/kc_map/CMakeLists.txt b/test/hotkey/kc_map/CMakeLists.txt index 20885f428..9d19764f7 100644 --- a/test/hotkey/kc_map/CMakeLists.txt +++ b/test/hotkey/kc_map/CMakeLists.txt @@ -7,5 +7,4 @@ add_executable(${test_name} ${source}) target_link_libraries(${test_name} hotkey) target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} pthread m) -add_dependencies(check ${test_name}) add_test(${test_name} ${test_name}) diff --git a/test/hotkey/key_window/CMakeLists.txt b/test/hotkey/key_window/CMakeLists.txt index 9318879b4..185d3903b 100644 --- a/test/hotkey/key_window/CMakeLists.txt +++ b/test/hotkey/key_window/CMakeLists.txt @@ -7,5 +7,4 @@ add_executable(${test_name} ${source}) target_link_libraries(${test_name} hotkey) target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} pthread m) -add_dependencies(check ${test_name}) add_test(${test_name} ${test_name}) diff --git a/test/protocol/admin/CMakeLists.txt b/test/protocol/admin/CMakeLists.txt index 220839b0f..033d68c24 100644 --- a/test/protocol/admin/CMakeLists.txt +++ b/test/protocol/admin/CMakeLists.txt @@ -7,5 +7,4 @@ add_executable(${test_name} ${source}) target_link_libraries(${test_name} protocol_${suite}) target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} pthread m) -add_dependencies(check ${test_name}) add_test(${test_name} ${test_name}) diff --git a/test/protocol/data/memcache/CMakeLists.txt b/test/protocol/data/memcache/CMakeLists.txt index b3bd0d51b..0f383ee7a 100644 --- a/test/protocol/data/memcache/CMakeLists.txt +++ b/test/protocol/data/memcache/CMakeLists.txt @@ -9,5 +9,4 @@ add_executable(${test_name} ${source}) target_link_libraries(${test_name} protocol_${suite}) target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} pthread m) -add_dependencies(check ${test_name}) add_test(${test_name} ${test_name}) diff --git a/test/protocol/data/redis/CMakeLists.txt b/test/protocol/data/redis/CMakeLists.txt index e2ff8fc0d..5ad3ecc29 100644 --- a/test/protocol/data/redis/CMakeLists.txt +++ b/test/protocol/data/redis/CMakeLists.txt @@ -7,5 +7,4 @@ add_executable(${test_name} ${source}) target_link_libraries(${test_name} protocol_${suite}) target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} pthread m) -add_dependencies(check ${test_name}) add_test(${test_name} ${test_name}) diff --git a/test/storage/cuckoo/CMakeLists.txt b/test/storage/cuckoo/CMakeLists.txt index acd221fd8..65fa98da2 100644 --- a/test/storage/cuckoo/CMakeLists.txt +++ b/test/storage/cuckoo/CMakeLists.txt @@ -9,5 +9,4 @@ target_link_libraries(${test_name} time) target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES}) target_link_libraries(${test_name} pthread m) -add_dependencies(check ${test_name}) add_test(${test_name} ${test_name}) diff --git a/test/storage/slab/CMakeLists.txt b/test/storage/slab/CMakeLists.txt index c88995d10..0cf14d30f 100644 --- a/test/storage/slab/CMakeLists.txt +++ b/test/storage/slab/CMakeLists.txt @@ -9,5 +9,5 @@ target_link_libraries(${test_name} time) target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES}) target_link_libraries(${test_name} pthread m) -add_dependencies(check ${test_name}) +#add_dependencies(check ${test_name}) add_test(${test_name} ${test_name}) diff --git a/test/time/CMakeLists.txt b/test/time/CMakeLists.txt index eb2497e8c..0a29b5dd7 100644 --- a/test/time/CMakeLists.txt +++ b/test/time/CMakeLists.txt @@ -7,5 +7,5 @@ add_executable(${test_name} ${source}) target_link_libraries(${test_name} ${suite}) target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES}) -add_dependencies(check ${test_name}) +#add_dependencies(check ${test_name}) add_test(${test_name} ${test_name})