test/CMakeLists.txt

Sun, 07 Feb 2021 12:20:07 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 07 Feb 2021 12:20:07 +0100
changeset 391
f094a53c1178
parent 390
d345541018fa
child 395
dc1bfe5ffd38
permissions
-rw-r--r--

adds allocator interface and default implementation

message(CHECK_START "Searching for CUnit test framework")

find_path(CUNIT_INCLUDE_DIR NAMES CUnit/CUnit.h)
find_library(CUNIT_LIBRARY NAMES cunit libcunit cunitlib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(CUnit DEFAULT_MSG CUNIT_LIBRARY CUNIT_INCLUDE_DIR)

if(CUNIT_FOUND)
    message(CHECK_PASS "found: compiling tests.")
    set(TESTS
            test_allocator
            test_list
    )

    foreach(test ${TESTS})
        add_executable(${test} ${test}.c)
        target_link_libraries(${test} PRIVATE ucx_static ${CUNIT_LIBRARY})
        add_test(NAME ${test} COMMAND ${test} WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
    endforeach()
else()
    message(CHECK_FAIL "not found: unit tests will not be available.")
endif()

mercurial