test/CMakeLists.txt

Sun, 26 Sep 2021 14:41:16 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 26 Sep 2021 14:41:16 +0200
changeset 422
afd87df80b13
parent 413
0f4aa9fc75d9
child 427
ec92b4ed23aa
permissions
-rw-r--r--

add utility to verify allocations

universe@391 1 message(CHECK_START "Searching for CUnit test framework")
universe@390 2
universe@391 3 find_path(CUNIT_INCLUDE_DIR NAMES CUnit/CUnit.h)
universe@391 4 find_library(CUNIT_LIBRARY NAMES cunit libcunit cunitlib)
universe@391 5 include(FindPackageHandleStandardArgs)
universe@391 6 find_package_handle_standard_args(CUnit DEFAULT_MSG CUNIT_LIBRARY CUNIT_INCLUDE_DIR)
universe@391 7
universe@391 8 if(CUNIT_FOUND)
universe@391 9 message(CHECK_PASS "found: compiling tests.")
universe@391 10 set(TESTS
universe@391 11 test_allocator
universe@413 12 test_list
universe@391 13 )
universe@391 14
universe@391 15 foreach(test ${TESTS})
universe@422 16 add_executable(${test} util_allocator.c ${test}.c)
universe@391 17 target_link_libraries(${test} PRIVATE ucx_static ${CUNIT_LIBRARY})
universe@395 18 target_include_directories(${test} PRIVATE ${CUNIT_INCLUDE_DIR})
universe@391 19 add_test(NAME ${test} COMMAND ${test} WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
universe@391 20 endforeach()
universe@391 21 else()
universe@391 22 message(CHECK_FAIL "not found: unit tests will not be available.")
universe@391 23 endif()

mercurial