File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
tests/beman/inplace_vector Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ option(
2727 ${PROJECT_IS_TOP_LEVEL}
2828)
2929
30+ include (FetchContent)
3031include (GNUInstallDirs)
3132
3233add_library(beman.inplace_vector INTERFACE)
@@ -59,6 +60,23 @@ install(
5960
6061if(BEMAN_INPLACE_VECTOR_BUILD_TESTS)
6162 include (CTest)
63+
64+ enable_testing()
65+
66+ # Fetch GoogleTest
67+ FetchContent_Declare(
68+ googletest
69+ GIT_REPOSITORY https ://github.com/google/googletest.git
70+ GIT_TAG
71+ f8d7d77c06936315286eb55f8de22cd23c188571 # release-1.14.0
72+ EXCLUDE_FROM_ALL
73+ )
74+
75+ block()
76+ set(INSTALL_GTEST OFF) # Disable GoogleTest installation
77+ FetchContent_MakeAvailable(googletest)
78+ endblock()
79+
6280 add_subdirectory(tests/beman/inplace_vector)
6381endif()
6482
Original file line number Diff line number Diff line change @@ -20,3 +20,15 @@ add_test(
2020 NAME beman.inplace_vector.ref-test
2121 COMMAND beman.inplace_vector.ref-test
2222)
23+
24+ # GoogleTest based tests
25+ include (GoogleTest)
26+
27+ add_executable(beman.inplace_vector.tests.spec)
28+ target_sources(beman.inplace_vector.tests.spec PRIVATE spec.test.cpp)
29+ target_link_libraries(
30+ beman.inplace_vector.tests.spec
31+ PRIVATE beman.inplace_vector GTest ::gtest GTest::gtest_main
32+ )
33+
34+ gtest_add_tests(beman.inplace_vector.tests.spec "" AUTO)
You can’t perform that action at this time.
0 commit comments