Skip to content

Commit

Permalink
tests: replace existing gtest 1.5.0 with gmock/gtest 1.7.0
Browse files Browse the repository at this point in the history
Google Testing Framework is included by default within the Google
C++ Mocking Framework.  Update makefiles to use new gmock/gtest
libraries and remove old gtest source code.

Signed-off-by: Jason Dillaman <[email protected]>
  • Loading branch information
Jason Dillaman committed Jan 26, 2015
1 parent 5cbe0c5 commit bf05ec1
Show file tree
Hide file tree
Showing 202 changed files with 40 additions and 153,551 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ vgcore.*
/ceph-[0-9]*/

# M4 Macro directory
m4/
/m4/

# where is this from?
web/*.html
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SYMBOL_CACHE_SIZE = 2
WARN_IF_UNDOCUMENTED = NO
INPUT = src
RECURSIVE = YES
EXCLUDE = src/gtest \
EXCLUDE = src/gmock \
src/test/virtualenv \
src/out
VERBATIM_HEADERS = NO
Expand Down
14 changes: 8 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AUTOMAKE_OPTIONS = gnu
ACLOCAL_AMFLAGS = -I m4
EXTRA_DIST = autogen.sh ceph.spec.in ceph.spec install-deps.sh
# the "." here makes sure check-local builds gtest before it is used
# the "." here makes sure check-local builds gtest and gmock before they are used
SUBDIRS = . src man

EXTRA_DIST += \
Expand All @@ -28,23 +28,25 @@ all-local:
if WITH_DEBUG
# We need gtest to build the rados-api tests. We only build those in
# a debug build, though.
@cd src/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.a lib/libgtest_main.a
@cd src/gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
@cd src/gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
endif

check-local: all
# We build gtest this way, instead of using SUBDIRS, because with that,
# gtest's own tests would be run and that would slow us down.
@cd src/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.a lib/libgtest_main.a
@cd src/gmock/gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
@cd src/gmock && $(MAKE) $(AM_MAKEFLAGS) lib/libgmock.la lib/libgmock_main.la
# exercise cli tools
$(srcdir)/src/test/run-cli-tests '$(top_builddir)/src/test'

# "make distclean" both runs this and recurses into src/gtest, if
# gtest is in DIST_SUBDIRS. Take extra care to not fail when
# effectively cleaned twice.
clean-local:
@if test -e src/gtest/Makefile; then \
echo "Making clean in src/gtest"; \
cd src/gtest && $(MAKE) $(AM_MAKEFLAGS) clean; \
@if test -e src/gmock/Makefile; then \
echo "Making clean in src/gmock"; \
cd src/gmock && $(MAKE) $(AM_MAKEFLAGS) clean; \
fi

@rm -rf src/test/virtualenv
Expand Down
2 changes: 1 addition & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ aclocal -I m4 --install
autoconf
autoheader
automake -a --add-missing -Wall
( cd src/gtest && autoreconf -fvi; )
( cd src/gmock && autoreconf -fvi; )
( cd src/rocksdb && autoreconf -fvi; )
exit
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ AC_MSG_NOTICE([RPM_RELEASE='$RPM_RELEASE'])

AC_CONFIG_MACRO_DIR([m4])

AC_CONFIG_SUBDIRS([src/gtest])
AC_CONFIG_SUBDIRS([src/gmock])

# Environment
AC_CANONICAL_HOST
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ endif(${WITH_MDS})
add_subdirectory(erasure-code)

# Support/Tools
add_subdirectory(gtest)
add_subdirectory(gmock)
add_subdirectory(test)
set(cephfs_srcs cephfs.cc)
add_executable(cephfstool ${cephfs_srcs})
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include Makefile-env.am

SUBDIRS += ocf java tracing
DIST_SUBDIRS += gtest ocf libs3 java tracing
DIST_SUBDIRS += gmock ocf libs3 java tracing



Expand Down
5 changes: 2 additions & 3 deletions src/gtest/.gitignore → src/gmock/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
fused-src
/scripts/gtest-config
/build-aux/config.h.in
/scripts/gmock-config
/build-aux/config.h
/build-aux/config.h.in
/build-aux/test-driver
/lib/
2 changes: 1 addition & 1 deletion src/gmock/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if HAVE_PTHREADS
endif

# Build rules for libraries.
lib_LTLIBRARIES = lib/libgmock.la lib/libgmock_main.la
noinst_LTLIBRARIES = lib/libgmock.la lib/libgmock_main.la

lib_libgmock_la_SOURCES = src/gmock-all.cc

Expand Down
Loading

0 comments on commit bf05ec1

Please sign in to comment.