Wed, 28 Jun 2023 20:36:25 +0200
improve how GTest config is passed during builds
universe@656 | 1 | # Use C++ for Testing |
universe@522 | 2 | set(CMAKE_CXX_STANDARD 17) |
universe@510 | 3 | |
universe@656 | 4 | # Load Google Test Framework |
universe@728 | 5 | option(INSTALL_GTEST "By default googletest shall not be installed." OFF) |
universe@728 | 6 | option(BUILD_GMOCK "In this project we do not need gmock." OFF) |
universe@510 | 7 | include(FetchContent) |
universe@510 | 8 | FetchContent_Declare( |
universe@510 | 9 | googletest |
universe@510 | 10 | GIT_REPOSITORY https://github.com/google/googletest.git |
universe@510 | 11 | GIT_TAG e2239ee6043f73722e7aa812a459f54a28552929 # release 1.11.0 |
universe@510 | 12 | ) |
universe@510 | 13 | # For Windows: Prevent overriding the parent project's compiler/linker settings |
universe@510 | 14 | set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) |
universe@510 | 15 | FetchContent_MakeAvailable(googletest) |
universe@510 | 16 | include(GoogleTest) |
universe@510 | 17 | message(STATUS "Google Test made available") |
universe@510 | 18 | |
universe@512 | 19 | add_executable(ucxtest |
universe@633 | 20 | test_utils.cpp |
universe@512 | 21 | test_allocator.cpp |
universe@631 | 22 | test_compare.cpp |
universe@583 | 23 | test_string.cpp |
universe@530 | 24 | test_buffer.cpp |
universe@517 | 25 | test_list.cpp |
universe@596 | 26 | test_hash_key.cpp |
universe@556 | 27 | test_map.cpp |
universe@691 | 28 | test_map_generics.c |
universe@727 | 29 | test_mempool.cpp |
universe@636 | 30 | test_printf.cpp |
universe@512 | 31 | selftest.cpp |
universe@518 | 32 | util_allocator.cpp |
universe@510 | 33 | ) |
universe@512 | 34 | target_link_libraries(ucxtest PRIVATE ucx_static gtest_main) |
universe@512 | 35 | gtest_discover_tests(ucxtest) |