Repository: mesos
Updated Branches:
  refs/heads/master 62d4ff53b -> ad6e67f97


Patched Google Test with upstream bugfix.

Per MESOS-8990, our Google Test dependency needs a patch from
upstream, https://github.com/google/googletest/pull/1620, in order to
continue building with the next version of MSVC (and potentially other
compilers).

This patch file was generated with `git format-patch` for the commit
`f66ab00704cd47e4e63ef6d425ca14b9192aaebb`.

Additionally, we need to define `GTEST_LANG_CXX11=1` when including
the GoogleTest headers such that the patch is used.

Review: https://reviews.apache.org/r/67916/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ad6e67f9
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ad6e67f9
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ad6e67f9

Branch: refs/heads/master
Commit: ad6e67f97abe3180babc28194f8ebbe7bfa5b305
Parents: 62d4ff5
Author: Andrew Schwartzmeyer <and...@schwartzmeyer.com>
Authored: Fri Jul 13 13:59:17 2018 -0700
Committer: Andrew Schwartzmeyer <and...@schwartzmeyer.com>
Committed: Tue Jul 31 11:01:37 2018 -0700

----------------------------------------------------------------------
 3rdparty/CMakeLists.txt                 | 12 ++++++--
 3rdparty/googletest-release-1.8.0.patch | 46 ++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/ad6e67f9/3rdparty/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt
index d8d113c..8300088 100644
--- a/3rdparty/CMakeLists.txt
+++ b/3rdparty/CMakeLists.txt
@@ -1065,10 +1065,15 @@ set_target_properties(
 set(GOOGLETEST_CMAKE_FORWARD_ARGS ${CMAKE_CXX_FORWARD_ARGS})
 
 if (WIN32)
+  set(GOOGLETEST_COMPILE_DEFINITIONS
+    # Silence deprecation warning in the interface of Google Test.
+    _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING
+    # Build in C++11 mode.
+    GTEST_LANG_CXX11=1)
+
   set_target_properties(
     gtest PROPERTIES
-    # Silence deprecation warning in the interface of Google Test.
-    INTERFACE_COMPILE_DEFINITIONS _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
+    INTERFACE_COMPILE_DEFINITIONS "${GOOGLETEST_COMPILE_DEFINITIONS}")
 
   if (CMAKE_GENERATOR MATCHES "Visual Studio")
     set_target_properties(
@@ -1105,6 +1110,8 @@ else ()
     IMPORTED_LOCATION 
${GOOGLETEST_ROOT}-build/googlemock/gtest/libgtest${CMAKE_STATIC_LIBRARY_SUFFIX})
 endif ()
 
+PATCH_CMD(GOOGLETEST_PATCH_CMD googletest-release-${GOOGLETEST_VERSION}.patch)
+
 MAKE_INCLUDE_DIR(gmock)
 MAKE_INCLUDE_DIR(gtest)
 GET_BYPRODUCTS(gmock)
@@ -1121,6 +1128,7 @@ ExternalProject_Add(
   ${GOOGLETEST_TARGET}
   PREFIX            ${GOOGLETEST_CMAKE_ROOT}
   BUILD_BYPRODUCTS  ${GMOCK_BYPRODUCTS};${GTEST_BYPRODUCTS}
+  PATCH_COMMAND     ${GOOGLETEST_PATCH_CMD}
   CMAKE_ARGS        ${GOOGLETEST_CMAKE_FORWARD_ARGS}
   INSTALL_COMMAND   ${CMAKE_NOOP}
   URL               ${GOOGLETEST_URL}

http://git-wip-us.apache.org/repos/asf/mesos/blob/ad6e67f9/3rdparty/googletest-release-1.8.0.patch
----------------------------------------------------------------------
diff --git a/3rdparty/googletest-release-1.8.0.patch 
b/3rdparty/googletest-release-1.8.0.patch
new file mode 100644
index 0000000..6626d98
--- /dev/null
+++ b/3rdparty/googletest-release-1.8.0.patch
@@ -0,0 +1,46 @@
+From f66ab00704cd47e4e63ef6d425ca14b9192aaebb Mon Sep 17 00:00:00 2001
+From: Gennadiy Civil <mist...@google.com>
+Date: Mon, 4 Jun 2018 10:45:56 -0400
+Subject: [PATCH] Upstream, cl/199129756
+
+Add printer for std::nullptr_t, addressing 
https://github.com/google/googletest/issues/1616
+---
+ googletest/include/gtest/gtest-printers.h | 4 ++++
+ googletest/test/gtest-printers_test.cc    | 6 ++++++
+ 2 files changed, 10 insertions(+)
+
+diff --git a/googletest/include/gtest/gtest-printers.h 
b/googletest/include/gtest/gtest-printers.h
+index e53963b42..373946b96 100644
+--- a/googletest/include/gtest/gtest-printers.h
++++ b/googletest/include/gtest/gtest-printers.h
+@@ -636,6 +636,10 @@ 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)"; 
}
++#endif  // GTEST_LANG_CXX11
++
+ #if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
+ // Helper function for printing a tuple.  T must be instantiated with
+ // a tuple type.
+diff --git a/googletest/test/gtest-printers_test.cc 
b/googletest/test/gtest-printers_test.cc
+index a373851d2..49b3bd462 100644
+--- a/googletest/test/gtest-printers_test.cc
++++ b/googletest/test/gtest-printers_test.cc
+@@ -1115,6 +1115,12 @@ TEST(PrintStdTupleTest, NestedTuple) {
+ 
+ #endif  // GTEST_LANG_CXX11
+ 
++#if GTEST_LANG_CXX11
++TEST(PrintNullptrT, Basic) {
++  EXPECT_EQ("(nullptr)", Print(nullptr));
++}
++#endif  // GTEST_LANG_CXX11
++
+ // Tests printing user-defined unprintable types.
+ 
+ // Unprintable types in the global namespace.
+-- 
+2.17.1
+

Reply via email to