Merge branch 'master' into python3-tests
This commit is contained in:
commit
90943525c5
|
@ -157,6 +157,9 @@ if (gmock_build_tests)
|
|||
cxx_test(gmock-generated-matchers_test gmock_main)
|
||||
cxx_test(gmock-internal-utils_test gmock_main)
|
||||
cxx_test(gmock-matchers_test gmock_main)
|
||||
if (MINGW)
|
||||
target_compile_options(gmock-matchers_test PRIVATE "-Wa,-mbig-obj")
|
||||
endif()
|
||||
cxx_test(gmock-more-actions_test gmock_main)
|
||||
cxx_test(gmock-nice-strict_test gmock_main)
|
||||
cxx_test(gmock-port_test gmock_main)
|
||||
|
|
|
@ -100,6 +100,7 @@
|
|||
#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
|
||||
#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
|
||||
|
||||
#include <functional>
|
||||
#include <ostream> // NOLINT
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
@ -639,7 +640,15 @@ inline void PrintTo(absl::string_view sp, ::std::ostream* os) {
|
|||
#endif // GTEST_HAS_ABSL
|
||||
|
||||
#if GTEST_LANG_CXX11
|
||||
|
||||
inline void PrintTo(std::nullptr_t, ::std::ostream* os) { *os << "(nullptr)"; }
|
||||
|
||||
template <typename T>
|
||||
void PrintTo(std::reference_wrapper<T> ref, ::std::ostream* os) {
|
||||
// Delegate to wrapped value.
|
||||
PrintTo(ref.get(), os);
|
||||
}
|
||||
|
||||
#endif // GTEST_LANG_CXX11
|
||||
|
||||
#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
|
||||
|
|
|
@ -38,14 +38,15 @@
|
|||
// Determines the platform on which Google Test is compiled.
|
||||
#ifdef __CYGWIN__
|
||||
# define GTEST_OS_CYGWIN 1
|
||||
# elif defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
|
||||
# define GTEST_OS_WINDOWS_MINGW 1
|
||||
# define GTEST_OS_WINDOWS 1
|
||||
#elif defined __SYMBIAN32__
|
||||
# define GTEST_OS_SYMBIAN 1
|
||||
#elif defined _WIN32
|
||||
# define GTEST_OS_WINDOWS 1
|
||||
# ifdef _WIN32_WCE
|
||||
# define GTEST_OS_WINDOWS_MOBILE 1
|
||||
# elif defined(__MINGW__) || defined(__MINGW32__)
|
||||
# define GTEST_OS_WINDOWS_MINGW 1
|
||||
# elif defined(WINAPI_FAMILY)
|
||||
# include <winapifamily.h>
|
||||
# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
|
|
|
@ -1112,9 +1112,25 @@ TEST(PrintStdTupleTest, NestedTuple) {
|
|||
#endif // GTEST_LANG_CXX11
|
||||
|
||||
#if GTEST_LANG_CXX11
|
||||
|
||||
TEST(PrintNullptrT, Basic) {
|
||||
EXPECT_EQ("(nullptr)", Print(nullptr));
|
||||
}
|
||||
|
||||
TEST(PrintReferenceWrapper, Printable) {
|
||||
int x = 5;
|
||||
EXPECT_EQ("5", Print(std::ref(x)));
|
||||
EXPECT_EQ("5", Print(std::cref(x)));
|
||||
}
|
||||
|
||||
TEST(PrintReferenceWrapper, Unprintable) {
|
||||
::foo::UnprintableInFoo up;
|
||||
EXPECT_EQ("16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>",
|
||||
Print(std::ref(up)));
|
||||
EXPECT_EQ("16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>",
|
||||
Print(std::cref(up)));
|
||||
}
|
||||
|
||||
#endif // GTEST_LANG_CXX11
|
||||
|
||||
// Tests printing user-defined unprintable types.
|
||||
|
|
|
@ -6826,7 +6826,7 @@ TEST(ColoredOutputTest, UsesColorsWhenStdoutIsTty) {
|
|||
TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
|
||||
GTEST_FLAG(color) = "auto";
|
||||
|
||||
#if GTEST_OS_WINDOWS
|
||||
#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MINGW
|
||||
// On Windows, we ignore the TERM variable as it's usually not set.
|
||||
|
||||
SetEnv("TERM", "dumb");
|
||||
|
|
Loading…
Reference in New Issue
Block a user