Skip to content

Commit

Permalink
Cleanup libcheck related code
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbiesek committed Sep 9, 2019
1 parent 683bc1a commit 6c6b2c7
Show file tree
Hide file tree
Showing 16 changed files with 4 additions and 18 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ if(BUILD_AND_INSTALL_CHECK)
set(CMAKE_REQUIRED_LIBRARIES "${CHECK_ROOT_DIR}/lib")
endif()

find_package(Check)

include(CheckIncludeFiles)
if(OS_PLATFORM STREQUAL "OS_LINUX")
check_include_files(linux/time64.h HAVE_TIME64)
Expand Down Expand Up @@ -155,7 +157,6 @@ endif(COVERAGE)
include(FindPackageHandleStandardArgs)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")

find_package(Check)
if(NOT CHECK_FOUND)
message(WARNING "Check is required to build and run tests")
endif(NOT CHECK_FOUND)
Expand Down Expand Up @@ -193,7 +194,8 @@ include_directories(
add_subdirectory(src)

if(CHECK_WORKING)
include_directories(${include_directories} "${CHECK_INCLUDES}")
include_directories(${CHECK_INCLUDE_DIRS})
link_directories(${CHECK_LIBRARY_DIRS})
add_subdirectory(test)
endif(CHECK_WORKING)

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(array)
add_subdirectory(bstring)
add_subdirectory(buffer)
Expand Down
1 change: 0 additions & 1 deletion test/array/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/bstring/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/buffer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/channel/pipe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/channel/tcp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/event/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/log/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ if(OS_PLATFORM STREQUAL "OS_DARWIN")
set_target_properties(${test_name} PROPERTIES LINK_FLAGS "-Wl,-F/System/Library/Frameworks")
endif()

add_dependencies(check ${test_name} ccommon-static)
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/metric/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/option/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/pool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/rbuf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/ring_array/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/time/timer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})
1 change: 0 additions & 1 deletion test/time/wheel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set(source check_${suite}.c)
add_executable(${test_name} ${source})
target_link_libraries(${test_name} ccommon-static ${CHECK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} m)

add_dependencies(check ${test_name})
add_test(${test_name} ${test_name})

0 comments on commit 6c6b2c7

Please sign in to comment.