1 cmake_minimum_required(VERSION 3.14) |
|
2 project(ucxtest VERSION 3.0 DESCRIPTION "UAP Common Extensions - Tests") |
|
3 |
|
4 # Configuration |
|
5 cmake_policy(SET CMP0077 NEW) |
|
6 set(CMAKE_CXX_STANDARD 17) |
|
7 enable_testing() |
|
8 |
|
9 # Load Google Test Framework |
|
10 option(INSTALL_GTEST "By default googletest shall not be installed." OFF) |
|
11 option(BUILD_GMOCK "In this project we do not need gmock." OFF) |
|
12 include(FetchContent) |
|
13 FetchContent_Declare( |
|
14 googletest |
|
15 GIT_REPOSITORY https://github.com/google/googletest.git |
|
16 GIT_TAG e2239ee6043f73722e7aa812a459f54a28552929 # release 1.11.0 |
|
17 ) |
|
18 # For Windows: Prevent overriding the parent project's compiler/linker settings |
|
19 set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) |
|
20 FetchContent_MakeAvailable(googletest) |
|
21 include(GoogleTest) |
|
22 message(STATUS "Google Test made available") |
|
23 |
|
24 add_executable(ucxtest |
|
25 test_utils.cpp |
|
26 test_allocator.cpp |
|
27 test_compare.cpp |
|
28 test_string.cpp |
|
29 test_buffer.cpp |
|
30 test_list.cpp |
|
31 test_hash_key.cpp |
|
32 test_map.cpp |
|
33 test_map_generics.c |
|
34 test_mempool.cpp |
|
35 test_printf.cpp |
|
36 selftest.cpp |
|
37 util_allocator.cpp |
|
38 ) |
|
39 target_include_directories(ucxtest PRIVATE ${CMAKE_SOURCE_DIR}/../src) |
|
40 target_link_libraries(ucxtest ${CMAKE_BINARY_DIR}/../libucx_static${STLIB_EXT} gtest_main) |
|
41 gtest_discover_tests(ucxtest) |
|