Sun, 26 Sep 2021 14:34:49 +0200
fix reallocate_null test not used and wrong
1 message(CHECK_START "Searching for CUnit test framework")
3 find_path(CUNIT_INCLUDE_DIR NAMES CUnit/CUnit.h)
4 find_library(CUNIT_LIBRARY NAMES cunit libcunit cunitlib)
5 include(FindPackageHandleStandardArgs)
6 find_package_handle_standard_args(CUnit DEFAULT_MSG CUNIT_LIBRARY CUNIT_INCLUDE_DIR)
8 if(CUNIT_FOUND)
9 message(CHECK_PASS "found: compiling tests.")
10 set(TESTS
11 test_allocator
12 test_list
13 )
15 foreach(test ${TESTS})
16 add_executable(${test} ${test}.c)
17 target_link_libraries(${test} PRIVATE ucx_static ${CUNIT_LIBRARY})
18 target_include_directories(${test} PRIVATE ${CUNIT_INCLUDE_DIR})
19 add_test(NAME ${test} COMMAND ${test} WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
20 endforeach()
21 else()
22 message(CHECK_FAIL "not found: unit tests will not be available.")
23 endif()