mirror of
https://github.com/google/googletest.git
synced 2025-04-05 05:25:03 +00:00
merge with main
This commit is contained in:
commit
c8dcbf28cc
6 changed files with 16 additions and 6 deletions
3
.github/workflows/gtest-ci.yml
vendored
3
.github/workflows/gtest-ci.yml
vendored
|
@ -4,6 +4,9 @@ on:
|
|||
push:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
BAZEL_CXXOPTS: -std=c++14
|
||||
|
||||
jobs:
|
||||
Linux:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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_;
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue