Skip to content

Commit 94932ac

Browse files
space-time-stack: allow API access to the stack + adding google test
1 parent b3ab0cb commit 94932ac

File tree

9 files changed

+898
-659
lines changed

9 files changed

+898
-659
lines changed

.github/workflows/build-with-kokkos.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,10 @@ jobs:
7171
exit -1
7272
esac
7373
74-
- name: Install CMake, OpenMPI, PAPI and dtrace
74+
- name: Install git, CMake, OpenMPI, PAPI and dtrace
7575
run: |
7676
apt --yes --no-install-recommends install \
77+
git ca-certificates \
7778
cmake make \
7879
libopenmpi-dev \
7980
systemtap-sdt-dev \

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ endif()
272272
# Tests
273273
if(KokkosTools_ENABLE_TESTS)
274274
enable_testing()
275+
include(cmake/BuildGTest.cmake)
275276
add_subdirectory(tests)
276277
endif()
277278

cmake/BuildGTest.cmake

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Look for Google Test and enable it as a target.
2+
#
3+
# The main targets that will be available are:
4+
# * GTest::gtest
5+
# * GTest::gmock
6+
#
7+
# References:
8+
# * https://github.com/google/googletest
9+
# * https://matgomes.com/integrate-google-test-into-cmake/
10+
# * https://google.github.io/googletest/quickstart-cmake.html
11+
# * https://jeremimucha.com/2021/04/cmake-fetchcontent/
12+
13+
include(FetchContent)
14+
15+
# Declare the Google Test dependency
16+
FetchContent_Declare(
17+
googletest
18+
GIT_REPOSITORY https://github.com/google/googletest.git
19+
GIT_TAG v1.14.0
20+
)
21+
22+
# If not yet populated, add Google Test to the build with the following options:
23+
# * disable installation of Google Test
24+
# * enable GMock
25+
# Note that we could have used FetchContent_MakeAvailable instead, but it would then
26+
# use the default configuration that would install Google Test.
27+
FetchContent_GetProperties(googletest)
28+
if (NOT googletest_POPULATED)
29+
FetchContent_Populate(googletest)
30+
31+
set(BUILD_GMOCK ON)
32+
set(INSTALL_GTEST OFF)
33+
34+
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
35+
endif()

0 commit comments

Comments
 (0)