Updated gMock to 1.7.0

This change updates gMock to the new release, 1.7.0.  This is
necessary for Android, as Android Master has updated their gTest to
1.7.0, and we must always use the matching version of gMock.

This should not break any existing tests, as 1.7.0 is
backwards-compatible with 1.6.0 code in nearly all cases.  There are
a few bugfixes around being too generous with type coercion in
EXPECT_THAT() and ASSERT_THAT() that could break code that was
accepted by the compiler before but was never technically safe.

For a full list of changes, including all the awesome new matchers
you can now use in your tests, see CHANGES, which is included from
gMock unchanged.

For a full list of modifications made to allow this to work on
Android Master, see the updated README.android.

No changes to the GYP files were necessary as part of this upgrade.

Change-Id: Ib1445044e78c9fe0cf16031d544577d65ebbf6df
This commit is contained in:
Jeff Tinker
2014-03-10 11:37:24 -07:00
parent b2af1e6303
commit f6ec81ffe7
34 changed files with 3493 additions and 1629 deletions

View File

@@ -1,70 +1,37 @@
# Copyright 2013 Google Inc. All Rights Reserved.
# Copyright 2014 Google Inc. All Rights Reserved.
# gMock builds 2 libraries: libgmock and libgmock_main. libgmock
# contains most of the code and libgmock_main just
# provide a common main to run the test. (i.e. If you link against
# libgmock_main you shouldn't provide a main() entry point.)
# gMock builds 2 libraries: libgmock and libgmock_main. libgmock contains most
# of the code and libgmock_main just provides a common main to run the test.
# (i.e. If you link against libgmock_main you shouldn't provide a main() entry
# point. If you link against libgmock_main, do not also link against
# libgtest_main, as libgmock_main is a superset of libgtest_main, and they will
# conflict in subtle ways.)
#
# We build these 2 libraries for the target device and for the host if
# it is running linux and using ASTL.
# We build these 2 libraries for the target device only.
LOCAL_PATH := $(call my-dir)
libgmock_target_includes := \
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../include \
external/gtest/include \
$(TOP)/external/gtest/include \
libgmock_host_includes := \
$(LOCAL_PATH)/.. \
$(LOCAL_PATH)/../include \
external/gtest/include \
$(TOP)/external/gtest/include \
#######################################################################
# gmock lib host
include $(CLEAR_VARS)
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES := gmock-all.cc
LOCAL_C_INCLUDES := $(libgmock_host_includes)
LOCAL_CFLAGS += -O0
LOCAL_MODULE := libgmock_host
include $(BUILD_HOST_STATIC_LIBRARY)
#######################################################################
# gmock_main lib host
include $(CLEAR_VARS)
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES := gmock_main.cc
LOCAL_C_INCLUDES := $(libgmock_host_includes)
LOCAL_CFLAGS += -O0
LOCAL_MODULE := libgmock_main_host
include $(BUILD_HOST_STATIC_LIBRARY)
libgmock_cflags := \
-DGTEST_HAS_TR1_TUPLE \
-DGTEST_USE_OWN_TR1_TUPLE \
-Wno-missing-field-initializers \
#######################################################################
# gmock lib target
include $(CLEAR_VARS)
ifeq ($(TARGET_ARCH), arm)
LOCAL_SDK_VERSION := 8
else
# NDK support of other archs (ie. x86 and mips) are only available after android-9
LOCAL_SDK_VERSION := 9
endif
LOCAL_SDK_VERSION := 9
LOCAL_NDK_STL_VARIANT := stlport_static
@@ -74,6 +41,8 @@ LOCAL_SRC_FILES := gmock-all.cc
LOCAL_C_INCLUDES := $(libgmock_target_includes)
LOCAL_CFLAGS += $(libgmock_cflags)
LOCAL_MODULE := libgmock
include $(BUILD_STATIC_LIBRARY)
@@ -83,12 +52,7 @@ include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
ifeq ($(TARGET_ARCH), arm)
LOCAL_SDK_VERSION := 8
else
# NDK support of other archs (ie. x86 and mips) are only available after android-9
LOCAL_SDK_VERSION := 9
endif
LOCAL_SDK_VERSION := 9
LOCAL_NDK_STL_VARIANT := stlport_static
@@ -98,6 +62,8 @@ LOCAL_SRC_FILES := gmock_main.cc
LOCAL_C_INCLUDES := $(libgmock_target_includes)
LOCAL_CFLAGS += $(libgmock_cflags)
LOCAL_MODULE := libgmock_main
include $(BUILD_STATIC_LIBRARY)