Update googletest to 1.8.0
authorTed Percival <ted.percival@echostar.com>
Mon, 27 Feb 2017 23:01:14 +0000 (15:01 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 27 Feb 2017 23:06:02 +0000 (15:06 -0800)
Summary:
`make check` was failing because <gmock.h> is included but not supplied. Updating to googletest 1.8.0 includes both googletest & googlemock, so `make check` now runs (and passes).
Closes https://github.com/facebook/folly/pull/547

Reviewed By: igorsugak

Differential Revision: D4593403

Pulled By: Orvid

fbshipit-source-id: 02f80e7b67e17562ff981e9c80a37f985eb685be

README.md
folly/test/Makefile.am

index bc6c47473c9c372a3f34954dfa9282b6120f9d02..bbaa2966edfe172023d822dab8be021216668b0b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -73,8 +73,15 @@ Folly is published on Github at https://github.com/facebook/folly
 folly requires gcc 4.8+ and a version of boost compiled with C++11 support.
 
 Please download googletest from
-https://github.com/google/googletest/archive/release-1.7.0.zip and unzip it in the
-folly/test subdirectory.
+https://github.com/google/googletest/archive/release-1.8.0.tar.gz and unpack it into the
+folly/test subdirectory as `gtest`:
+
+    (cd folly/test && \
+     rm -rf gtest && \
+     wget https://github.com/google/googletest/archive/release-1.8.0.tar.gz && \
+     tar zxf release-1.8.0.tar.gz && \
+     rm -f release-1.8.0.tar.gz && \
+     mv googletest-release-1.8.0 gtest)
 
 #### Ubuntu 12.04
 
index 409467e395964816cb263747b2830b5e2dec7eb5..9d983a3d692893fb37dae73834e9577c5d8d4215 100644 (file)
@@ -2,7 +2,7 @@ SUBDIRS = . function_benchmark
 
 ACLOCAL_AMFLAGS = -I m4
 
-CPPFLAGS += -Igtest-1.7.0/include
+CPPFLAGS += -isystem gtest/googletest/include -isystem gtest/googlemock/include
 
 TESTS= \
        sorted_vector_types_test \
@@ -20,8 +20,8 @@ check_LTLIBRARIES = libfollytestmain.la libgtest.la
 check_PROGRAMS =
 noinst_LTLIBRARIES = thread_local_test_lib.la
 
-libgtest_la_CPPFLAGS = -Igtest-1.7.0 -Igtest-1.7.0/src
-libgtest_la_SOURCES = gtest-1.7.0/src/gtest-all.cc
+libgtest_la_CPPFLAGS = -isystem gtest/googletest
+libgtest_la_SOURCES = gtest/googletest/src/gtest-all.cc
 
 if FOLLY_TESTMAIN
 libfollytestmain_la_CPPFLAGS = $(AM_CPPFLAGS) $(libgtest_la_CPPFLAGS)
@@ -29,7 +29,7 @@ libfollytestmain_la_SOURCES = $(libgtest_la_SOURCES) common/TestMain.cpp
 libfollytestmain_la_LIBADD = $(top_builddir)/init/libfollyinit.la $(top_builddir)/libfolly.la
 else
 libfollytestmain_la_CPPFLAGS = $(libgtest_la_CPPFLAGS)
-libfollytestmain_la_SOURCES = $(libgtest_la_SOURCES) gtest-1.7.0/src/gtest_main.cc
+libfollytestmain_la_SOURCES = $(libgtest_la_SOURCES) gtest/googletest/src/gtest_main.cc
 libfollytestmain_la_LIBADD = $(top_builddir)/libfolly.la
 endif