tests/CMakeLists.txt

Wed, 28 Jun 2023 20:36:25 +0200

author
Mike Becker <universe@uap-core.de>
date
Wed, 28 Jun 2023 20:36:25 +0200
changeset 728
71c4ac35c1ce
parent 727
d92a59f5d261
child 753
24dc84788dee
permissions
-rw-r--r--

improve how GTest config is passed during builds

     1 # Use C++ for Testing
     2 set(CMAKE_CXX_STANDARD 17)
     4 # Load Google Test Framework
     5 option(INSTALL_GTEST "By default googletest shall not be installed." OFF)
     6 option(BUILD_GMOCK "In this project we do not need gmock." OFF)
     7 include(FetchContent)
     8 FetchContent_Declare(
     9         googletest
    10         GIT_REPOSITORY https://github.com/google/googletest.git
    11         GIT_TAG e2239ee6043f73722e7aa812a459f54a28552929 # release 1.11.0
    12 )
    13 # For Windows: Prevent overriding the parent project's compiler/linker settings
    14 set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
    15 FetchContent_MakeAvailable(googletest)
    16 include(GoogleTest)
    17 message(STATUS "Google Test made available")
    19 add_executable(ucxtest
    20         test_utils.cpp
    21         test_allocator.cpp
    22         test_compare.cpp
    23         test_string.cpp
    24         test_buffer.cpp
    25         test_list.cpp
    26         test_hash_key.cpp
    27         test_map.cpp
    28         test_map_generics.c
    29         test_mempool.cpp
    30         test_printf.cpp
    31         selftest.cpp
    32         util_allocator.cpp
    33         )
    34 target_link_libraries(ucxtest PRIVATE ucx_static gtest_main)
    35 gtest_discover_tests(ucxtest)

mercurial