tests/CMakeLists.txt

Wed, 18 Oct 2023 21:07:02 +0200

author
Mike Becker <universe@uap-core.de>
date
Wed, 18 Oct 2023 21:07:02 +0200
changeset 754
4bc7d966c9db
parent 753
24dc84788dee
child 756
0b635553b86a
permissions
-rw-r--r--

add an uwproj based install target

753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents: 728
diff changeset
1 cmake_minimum_required(VERSION 3.14)
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents: 728
diff changeset
2 project(ucxtest VERSION 3.0 DESCRIPTION "UAP Common Extensions - Tests")
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents: 728
diff changeset
3
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents: 728
diff changeset
4 # Configuration
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents: 728
diff changeset
5 cmake_policy(SET CMP0077 NEW)
522
b91c50d023f4 add [[maybe_unused]] attributed to params of mocked function
Mike Becker <universe@uap-core.de>
parents: 518
diff changeset
6 set(CMAKE_CXX_STANDARD 17)
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents: 728
diff changeset
7 enable_testing()
510
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
8
656
2ccb9f881420 fix gmock being build and gtest and gmock being installed
Mike Becker <universe@uap-core.de>
parents: 653
diff changeset
9 # Load Google Test Framework
728
71c4ac35c1ce improve how GTest config is passed during builds
Mike Becker <universe@uap-core.de>
parents: 727
diff changeset
10 option(INSTALL_GTEST "By default googletest shall not be installed." OFF)
71c4ac35c1ce improve how GTest config is passed during builds
Mike Becker <universe@uap-core.de>
parents: 727
diff changeset
11 option(BUILD_GMOCK "In this project we do not need gmock." OFF)
510
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
12 include(FetchContent)
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
13 FetchContent_Declare(
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
14 googletest
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
15 GIT_REPOSITORY https://github.com/google/googletest.git
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
16 GIT_TAG e2239ee6043f73722e7aa812a459f54a28552929 # release 1.11.0
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
17 )
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
18 # For Windows: Prevent overriding the parent project's compiler/linker settings
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
19 set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
20 FetchContent_MakeAvailable(googletest)
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
21 include(GoogleTest)
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
22 message(STATUS "Google Test made available")
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
23
512
096d206b63f9 compile only one single binary for tests
Mike Becker <universe@uap-core.de>
parents: 511
diff changeset
24 add_executable(ucxtest
633
63a692642aa2 add utils tests
Mike Becker <universe@uap-core.de>
parents: 631
diff changeset
25 test_utils.cpp
512
096d206b63f9 compile only one single binary for tests
Mike Becker <universe@uap-core.de>
parents: 511
diff changeset
26 test_allocator.cpp
631
406376e64fd8 tests for compare functions
Mike Becker <universe@uap-core.de>
parents: 596
diff changeset
27 test_compare.cpp
583
0f3c9662f9b5 add tests and missing implementations for strings
Mike Becker <universe@uap-core.de>
parents: 571
diff changeset
28 test_string.cpp
530
e866516cac17 #170 first buffer tests
Mike Becker <universe@uap-core.de>
parents: 522
diff changeset
29 test_buffer.cpp
517
b3baaf9b7e3c migrate list tests to gtest
Mike Becker <universe@uap-core.de>
parents: 515
diff changeset
30 test_list.cpp
596
52fcaf3c9154 #216 test hashing functions
Mike Becker <universe@uap-core.de>
parents: 583
diff changeset
31 test_hash_key.cpp
556
3d19cae7e924 #199 tests for hash map
Mike Becker <universe@uap-core.de>
parents: 530
diff changeset
32 test_map.cpp
691
65baf7f45ac8 bring a generic interface to CxMap
Mike Becker <universe@uap-core.de>
parents: 656
diff changeset
33 test_map_generics.c
727
d92a59f5d261 improve mempool implementation
Mike Becker <universe@uap-core.de>
parents: 718
diff changeset
34 test_mempool.cpp
636
cfcc8cf0168c add printf tests
Mike Becker <universe@uap-core.de>
parents: 633
diff changeset
35 test_printf.cpp
512
096d206b63f9 compile only one single binary for tests
Mike Becker <universe@uap-core.de>
parents: 511
diff changeset
36 selftest.cpp
518
74d0372f5c6f improve testing allocator + add tests for it
Mike Becker <universe@uap-core.de>
parents: 517
diff changeset
37 util_allocator.cpp
510
133ac0f8f3fc add googletest framework
Mike Becker <universe@uap-core.de>
parents: 427
diff changeset
38 )
753
24dc84788dee replace most of the build system with uwproj
Mike Becker <universe@uap-core.de>
parents: 728
diff changeset
39 target_link_libraries(ucxtest ${CMAKE_BINARY_DIR}/../libucx${STLIB_EXT} gtest_main)
512
096d206b63f9 compile only one single binary for tests
Mike Becker <universe@uap-core.de>
parents: 511
diff changeset
40 gtest_discover_tests(ucxtest)

mercurial