diff --git a/.gitignore b/.gitignore index d4b0cddb72..c623f8045c 100644 --- a/.gitignore +++ b/.gitignore @@ -71,8 +71,8 @@ test-reports/ /symbols/ # Testing -/testing/gmock-*.zip -/testing/gmock/ +/testing/googletest.zip +/testing/googletest/ # Generated source /buildscripts/launchers/micromanager diff --git a/configure.ac b/configure.ac index d9eb6b076a..8b37af871a 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ AC_PROG_CC([clang llvm-gcc gcc cc]) # Testing (googletest, googlemock) # See testing/setuptesting.sh -MM_GMOCK([$srcdir/testing/gmock], [\$(top_srcdir)/testing/gmock]) +MM_GMOCK([$srcdir/testing/googletest], [\$(top_srcdir)/testing/googletest]) AM_CONDITIONAL([BUILD_CPP_TESTS], [test "x$have_gmock" = xyes]) diff --git a/m4/mm_gmock.m4 b/m4/mm_gmock.m4 index a32cdf6569..ac35733961 100644 --- a/m4/mm_gmock.m4 +++ b/m4/mm_gmock.m4 @@ -1,14 +1,17 @@ -# MM_GMOCK(gmock-src-dir, make-gmock-src-dir) +# MM_GMOCK(gtest-src-dir, make-gtest-src-dir) # Sets have_gmock to yes or no; if yes, sets the GMOCK_CPPFLAGS substitution # variable. +# Note: This is named gmock because the gmock package used to contain gtest. +# Now it is the other way around. This test is written only for the particular +# googletest version we use. AC_DEFUN([MM_GMOCK], [ - AC_MSG_CHECKING([for gmock source in $1]) - AS_IF([test -f $1/src/gmock-all.cc], + AC_MSG_CHECKING([for googletest source in $1]) + AS_IF([test -f $1/googletest/src/gtest-all.cc], [ AC_MSG_RESULT([yes]) have_gmock=yes - GMOCK_DIR="$2" - GTEST_DIR="$GMOCK_DIR/gtest" + GTEST_DIR="$2/googletest" + GMOCK_DIR="$2/googlemock" AC_SUBST([GMOCK_CPPFLAGS], ["-isystem $GTEST_DIR/include -isystem $GMOCK_DIR/include"]) ], diff --git a/testing/Makefile.am b/testing/Makefile.am index 4db4f27f99..440b663c7f 100644 --- a/testing/Makefile.am +++ b/testing/Makefile.am @@ -1,6 +1,8 @@ AUTOMAKE_OPTIONS = subdir-objects check_LTLIBRARIES = libgmock.la -libgmock_la_CPPFLAGS = $(GMOCK_CPPFLAGS) -Igmock -Igmock/gtest -libgmock_la_SOURCES = gmock/gtest/src/gtest-all.cc \ - gmock/src/gmock-all.cc +libgmock_la_CPPFLAGS = $(GMOCK_CPPFLAGS) \ + -Igoogletest/googletest \ + -Igoogletest/googlemock +libgmock_la_SOURCES = googletest/googletest/src/gtest-all.cc \ + googletest/googlemock/src/gmock-all.cc diff --git a/testing/setuptesting.sh b/testing/setuptesting.sh index df164d45bb..10b9325bbe 100755 --- a/testing/setuptesting.sh +++ b/testing/setuptesting.sh @@ -8,22 +8,22 @@ set -e cd `dirname $0` rm -rf gmock -GMOCK_VERSION=1.7.0 -GMOCK="gmock-$GMOCK_VERSION" -GMOCK_SHA1=f9d9dd882a25f4069ed9ee48e70aff1b53e3c5a5 +# 1.8.1 is last version supporting pre-C++11 compilers +GTEST_VER=1.8.1 +GTEST_SHA1=7b41ea3682937069e3ce32cb06619fead505795e if test -f $GMOCK.zip then : else - curl -LO https://googlemock.googlecode.com/files/$GMOCK.zip + curl -L -o googletest.zip https://github.com/google/googletest/archive/release-$GTEST_VER.zip fi cat >sha1sums.tmp <