Skip to content

Commit 96284ab

Browse files
committed
Revert to ubuntu-latest image for linux build jobs.
Update GTest.cmake enforcing C++17 standard for building unit tests.
1 parent 9e3975f commit 96284ab

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.github/workflows/run-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
build-and-test:
1818
name: Build and execute unit tests
1919

20-
runs-on: ubuntu-22.04
20+
runs-on: ubuntu-latest
2121

2222
steps:
2323
- name: Install googletest

Modules/GTest.cmake

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
# This file is part of FEDEM - https://openfedem.org
66

77
# This cmake file adds the wrapper function add_cpp_test()
8-
# which adds a C++ unit test using the google test framwork
9-
# to the build project, if the googletest package is installed.
8+
# which adds a C++ unit test using the GoogleTest framework
9+
# to the build project, if that package is installed.
1010

11-
# Needed to get google test working
11+
# Needed to get GoogleTest working
1212
if ( POLICY CMP0057 )
1313
cmake_policy ( SET CMP0057 NEW ) # allow the IN_LIST keyword
1414
endif ( POLICY CMP0057 )
@@ -19,7 +19,7 @@ if ( POLICY CMP0144 )
1919
cmake_policy ( SET CMP0144 OLD ) # ignoring <PACKAGE>_ROOT variables
2020
endif ( POLICY CMP0144 )
2121

22-
# Find the google unit testing framework
22+
# Find the GoogleTest framework for unit testing
2323
find_path ( GTEST_ROOT gtest.h PATHS "$ENV{GTEST_ROOT}/include/gtest" )
2424
if ( GTEST_ROOT )
2525
find_package ( GTest )
@@ -30,6 +30,8 @@ if ( GTest_FOUND )
3030
# Wrapper for gtest_add_tests
3131
function ( add_cpp_test TARGET )
3232
message ( STATUS "INFORMATION : Adding unit tests from ${TARGET}" )
33+
# GoogleTest now requires the C++17 standard
34+
set_property ( TARGET ${TARGET} PROPERTY CXX_STANDARD 17 )
3335
gtest_add_tests ( ${TARGET} "--srcdir=${CMAKE_CURRENT_SOURCE_DIR}" AUTO )
3436
if ( ${ARGC} GREATER 1 )
3537
target_link_libraries ( ${TARGET} ${ARGN} )

0 commit comments

Comments
 (0)