summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/gtest-ci.yml3
-rw-r--r--docs/quickstart-cmake.md5
-rw-r--r--googlemock/src/gmock-internal-utils.cc3
-rw-r--r--googletest/cmake/internal_utils.cmake6
-rw-r--r--googletest/include/gtest/internal/gtest-internal.h3
-rw-r--r--googletest/src/gtest.cc2
6 files changed, 16 insertions, 6 deletions
diff --git a/.github/workflows/gtest-ci.yml b/.github/workflows/gtest-ci.yml
index 61fd47e..036c392 100644
--- a/.github/workflows/gtest-ci.yml
+++ b/.github/workflows/gtest-ci.yml
@@ -4,6 +4,9 @@ on:
push:
pull_request:
+env:
+ BAZEL_CXXOPTS: -std=c++14
+
jobs:
Linux:
runs-on: ubuntu-latest
diff --git a/docs/quickstart-cmake.md b/docs/quickstart-cmake.md
index fb72f38..2988761 100644
--- a/docs/quickstart-cmake.md
+++ b/docs/quickstart-cmake.md
@@ -58,7 +58,8 @@ set(CMAKE_CXX_STANDARD 14)
include(FetchContent)
FetchContent_Declare(
googletest
- URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
+ GIT_REPOSITORY https://github.com/google/googletest.git
+ GIT_TAG release-1.12.1
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
@@ -108,7 +109,7 @@ add_executable(
)
target_link_libraries(
hello_test
- gtest_main
+ GTest::gtest_main
)
include(GoogleTest)
diff --git a/googlemock/src/gmock-internal-utils.cc b/googlemock/src/gmock-internal-utils.cc
index 9e2d9b8..f7d740c 100644
--- a/googlemock/src/gmock-internal-utils.cc
+++ b/googlemock/src/gmock-internal-utils.cc
@@ -180,7 +180,8 @@ GTEST_API_ void Log(LogSeverity severity, const std::string& message,
std::cout << "\n";
}
std::cout << "Stack trace:\n"
- << ::testing::internal::GetCurrentOsStackTraceExceptTop(actual_to_skip);
+ << ::testing::internal::GetCurrentOsStackTraceExceptTop(
+ actual_to_skip);
}
std::cout << ::std::flush;
}
diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake
index 5a34c07..107147f 100644
--- a/googletest/cmake/internal_utils.cmake
+++ b/googletest/cmake/internal_utils.cmake
@@ -82,7 +82,9 @@ macro(config_compiler_and_linker)
# http://stackoverflow.com/questions/3232669 explains the issue.
set(cxx_base_flags "${cxx_base_flags} -wd4702")
# Ensure MSVC treats source files as UTF-8 encoded.
- set(cxx_base_flags "${cxx_base_flags} -utf-8")
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ set(cxx_base_flags "${cxx_base_flags} -utf-8")
+ endif()
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(cxx_base_flags "-Wall -Wshadow -Wconversion")
set(cxx_exception_flags "-fexceptions")
@@ -189,7 +191,7 @@ function(cxx_library_with_type name type cxx_flags)
endif()
if (NOT "${CMAKE_VERSION}" VERSION_LESS "3.8")
- target_compile_features(${name} PUBLIC cxx_std_11)
+ target_compile_features(${name} PUBLIC cxx_std_14)
endif()
endfunction()
diff --git a/googletest/include/gtest/internal/gtest-internal.h b/googletest/include/gtest/internal/gtest-internal.h
index 527dc99..74521db 100644
--- a/googletest/include/gtest/internal/gtest-internal.h
+++ b/googletest/include/gtest/internal/gtest-internal.h
@@ -57,6 +57,7 @@
#include <string.h>
#include <cstdint>
+#include <functional>
#include <iomanip>
#include <limits>
#include <map>
@@ -631,7 +632,7 @@ class GTEST_API_ TypedTestSuitePState {
const char* registered_tests);
private:
- typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;
+ typedef ::std::map<std::string, CodeLocation, std::less<>> RegisteredTestsMap;
bool registered_;
RegisteredTestsMap registered_tests_;
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 9989f71..a1b2b5d 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -372,6 +372,8 @@ GTEST_DEFINE_string_(
namespace testing {
namespace internal {
+const uint32_t Random::kMaxRange;
+
// Generates a random number from [0, range), using a Linear
// Congruential Generator (LCG). Crashes if 'range' is 0 or greater
// than kMaxRange.