Skip to content

Commit

Permalink
space-time-stack: allow API access to the stack + adding google test
Browse files Browse the repository at this point in the history
  • Loading branch information
romintomasetti committed Feb 6, 2024
1 parent b3ab0cb commit 94932ac
Show file tree
Hide file tree
Showing 9 changed files with 898 additions and 659 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-with-kokkos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ jobs:
exit -1
esac
- name: Install CMake, OpenMPI, PAPI and dtrace
- name: Install git, CMake, OpenMPI, PAPI and dtrace
run: |
apt --yes --no-install-recommends install \
git ca-certificates \
cmake make \
libopenmpi-dev \
systemtap-sdt-dev \
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ endif()
# Tests
if(KokkosTools_ENABLE_TESTS)
enable_testing()
include(cmake/BuildGTest.cmake)
add_subdirectory(tests)
endif()

Expand Down
35 changes: 35 additions & 0 deletions cmake/BuildGTest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Look for Google Test and enable it as a target.
#
# The main targets that will be available are:
# * GTest::gtest
# * GTest::gmock
#
# References:
# * https://github.com/google/googletest
# * https://matgomes.com/integrate-google-test-into-cmake/
# * https://google.github.io/googletest/quickstart-cmake.html
# * https://jeremimucha.com/2021/04/cmake-fetchcontent/

include(FetchContent)

# Declare the Google Test dependency
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.14.0
)

# If not yet populated, add Google Test to the build with the following options:
# * disable installation of Google Test
# * enable GMock
# Note that we could have used FetchContent_MakeAvailable instead, but it would then
# use the default configuration that would install Google Test.
FetchContent_GetProperties(googletest)
if (NOT googletest_POPULATED)
FetchContent_Populate(googletest)

set(BUILD_GMOCK ON)
set(INSTALL_GTEST OFF)

add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
Loading

0 comments on commit 94932ac

Please sign in to comment.