Skip to content

Commit

Permalink
fix check related config
Browse files Browse the repository at this point in the history
  • Loading branch information
Yao Yue committed Jul 23, 2019
1 parent e2e7f4a commit 14fcd34
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 23 deletions.
15 changes: 9 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 0 additions & 1 deletion test/data_structure/bitmap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
1 change: 0 additions & 1 deletion test/data_structure/intarray/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
7 changes: 4 additions & 3 deletions test/data_structure/intarray/check_intarray.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include <data_structure/intarray/intarrah.h>
#include <data_structure/intarray/intarray.h>

#include <cc_mm.h>
#include <stdio.h>
#include <stdlib.h>

#include <check.h>

Expand All @@ -12,7 +13,7 @@
#define BUF_SIZE 8200
#define NENTRY 1024

static char buf[BUF_SIZE];
static unsigned char buf[BUF_SIZE];


/*
Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion test/data_structure/ziplist/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
1 change: 0 additions & 1 deletion test/datapool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
1 change: 0 additions & 1 deletion test/hotkey/kc_map/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
1 change: 0 additions & 1 deletion test/hotkey/key_window/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
1 change: 0 additions & 1 deletion test/protocol/admin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
1 change: 0 additions & 1 deletion test/protocol/data/memcache/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
1 change: 0 additions & 1 deletion test/protocol/data/redis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
1 change: 0 additions & 1 deletion test/storage/cuckoo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion test/storage/slab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion test/time/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

0 comments on commit 14fcd34

Please sign in to comment.