test/CMakeLists.txt

Sun, 26 Sep 2021 13:41:52 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 26 Sep 2021 13:41:52 +0200
changeset 420
8eb6faa2edba
parent 413
0f4aa9fc75d9
child 422
afd87df80b13
child 425
a75b808d653b
permissions
-rw-r--r--

change detection of Doxygen

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})
        target_include_directories(${test} PRIVATE ${CUNIT_INCLUDE_DIR})
        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