aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock
diff options
context:
space:
mode:
authorGennadiy Civil <gennadiycivil@users.noreply.github.com>2018-01-09 00:22:32 -0500
committerGitHub <noreply@github.com>2018-01-09 00:22:32 -0500
commit0e6da4cead72ab739171bbe98570da971c3283b6 (patch)
tree99a678b6b6fe1c8bc76e14287a9b7026c03019b7 /googlemock
parentcdedd189b22a6578e935256294175b9884e3cf17 (diff)
parente194f52114a181cb3fb420d58d5ae2250207e828 (diff)
downloadgoogletest-0e6da4cead72ab739171bbe98570da971c3283b6.tar.gz
googletest-0e6da4cead72ab739171bbe98570da971c3283b6.tar.bz2
googletest-0e6da4cead72ab739171bbe98570da971c3283b6.zip
Merge branch 'master' into fix-core-dump-shared
Diffstat (limited to 'googlemock')
-rw-r--r--googlemock/CMakeLists.txt14
-rw-r--r--googlemock/README.md32
-rw-r--r--googlemock/configure.ac2
-rw-r--r--googlemock/docs/DevGuide.md132
-rw-r--r--googlemock/docs/Documentation.md2
-rw-r--r--googlemock/include/gmock/gmock-matchers.h4
-rw-r--r--googlemock/src/gmock-spec-builders.cc2
-rw-r--r--googlemock/test/BUILD.bazel5
-rw-r--r--googlemock/test/gmock-internal-utils_test.cc8
-rw-r--r--googlemock/test/gmock-matchers_test.cc4
10 files changed, 18 insertions, 187 deletions
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt
index 7b91a411..bac2e3bf 100644
--- a/googlemock/CMakeLists.txt
+++ b/googlemock/CMakeLists.txt
@@ -110,8 +110,8 @@ endif()
# to the targets for when we are part of a parent build (ie being pulled
# in via add_subdirectory() rather than being a standalone build).
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
- target_include_directories(gmock INTERFACE "${gmock_SOURCE_DIR}/include")
- target_include_directories(gmock_main INTERFACE "${gmock_SOURCE_DIR}/include")
+ target_include_directories(gmock SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include")
+ target_include_directories(gmock_main SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include")
endif()
########################################################################
@@ -119,11 +119,11 @@ endif()
# Install rules
if(INSTALL_GMOCK)
install(TARGETS gmock gmock_main
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
- install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+ install(DIRECTORY "${gmock_SOURCE_DIR}/include/gmock"
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
# configure and install pkgconfig files
configure_file(
diff --git a/googlemock/README.md b/googlemock/README.md
index f941f158..1170cfab 100644
--- a/googlemock/README.md
+++ b/googlemock/README.md
@@ -337,38 +337,6 @@ use the new matcher API (
[polymorphic](./docs/CookBook.md#writing-new-polymorphic-matchers)).
Matchers defined using `MATCHER()` or `MATCHER_P*()` aren't affected.
-### Developing Google Mock ###
-
-This section discusses how to make your own changes to Google Mock.
-
-#### Testing Google Mock Itself ####
-
-To make sure your changes work as intended and don't break existing
-functionality, you'll want to compile and run Google Test's own tests.
-For that you'll need Autotools. First, make sure you have followed
-the instructions above to configure Google Mock.
-Then, create a build output directory and enter it. Next,
-
- ${GMOCK_DIR}/configure # try --help for more info
-
-Once you have successfully configured Google Mock, the build steps are
-standard for GNU-style OSS packages.
-
- make # Standard makefile following GNU conventions
- make check # Builds and runs all tests - all should pass.
-
-Note that when building your project against Google Mock, you are building
-against Google Test as well. There is no need to configure Google Test
-separately.
-
-#### Contributing a Patch ####
-
-We welcome patches.
-Please read the [Developer's Guide](docs/DevGuide.md)
-for how you can contribute. In particular, make sure you have signed
-the Contributor License Agreement, or we won't be able to accept the
-patch.
-
Happy testing!
[gtest_readme]: ../googletest/README.md "googletest"
diff --git a/googlemock/configure.ac b/googlemock/configure.ac
index c23ed455..cb5e1a6a 100644
--- a/googlemock/configure.ac
+++ b/googlemock/configure.ac
@@ -129,7 +129,7 @@ AS_IF([test "x${HAVE_BUILT_GTEST}" = "xyes"],
GTEST_LDFLAGS=`${GTEST_CONFIG} --ldflags`
GTEST_LIBS=`${GTEST_CONFIG} --libs`
GTEST_VERSION=`${GTEST_CONFIG} --version`],
- [AC_CONFIG_SUBDIRS([../googletest])
+ [
# GTEST_CONFIG needs to be executable both in a Makefile environment and
# in a shell script environment, so resolve an absolute path for it here.
GTEST_CONFIG="`pwd -P`/../googletest/scripts/gtest-config"
diff --git a/googlemock/docs/DevGuide.md b/googlemock/docs/DevGuide.md
deleted file mode 100644
index cae07e70..00000000
--- a/googlemock/docs/DevGuide.md
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
-If you are interested in understanding the internals of Google Mock,
-building from source, or contributing ideas or modifications to the
-project, then this document is for you.
-
-# Introduction #
-
-First, let's give you some background of the project.
-
-## Licensing ##
-
-All Google Mock source and pre-built packages are provided under the [New BSD License](http://www.opensource.org/licenses/bsd-license.php).
-
-## The Google Mock Community ##
-
-The Google Mock community exists primarily through the [discussion group](http://groups.google.com/group/googlemock), the
-[issue tracker](https://github.com/google/googletest/issues) and, to a lesser extent, the [source control repository](../). You are definitely encouraged to contribute to the
-discussion and you can also help us to keep the effectiveness of the
-group high by following and promoting the guidelines listed here.
-
-### Please Be Friendly ###
-
-Showing courtesy and respect to others is a vital part of the Google
-culture, and we strongly encourage everyone participating in Google
-Mock development to join us in accepting nothing less. Of course,
-being courteous is not the same as failing to constructively disagree
-with each other, but it does mean that we should be respectful of each
-other when enumerating the 42 technical reasons that a particular
-proposal may not be the best choice. There's never a reason to be
-antagonistic or dismissive toward anyone who is sincerely trying to
-contribute to a discussion.
-
-Sure, C++ testing is serious business and all that, but it's also
-a lot of fun. Let's keep it that way. Let's strive to be one of the
-friendliest communities in all of open source.
-
-### Where to Discuss Google Mock ###
-
-As always, discuss Google Mock in the official [Google C++ Mocking Framework discussion group](http://groups.google.com/group/googlemock). You don't have to actually submit
-code in order to sign up. Your participation itself is a valuable
-contribution.
-
-# Working with the Code #
-
-If you want to get your hands dirty with the code inside Google Mock,
-this is the section for you.
-
-## Checking Out the Source from Subversion ##
-
-Checking out the Google Mock source is most useful if you plan to
-tweak it yourself. You check out the source for Google Mock using a
-[Subversion](http://subversion.tigris.org/) client as you would for any
-other project hosted on Google Code. Please see the instruction on
-the [source code access page](../) for how to do it.
-
-## Compiling from Source ##
-
-Once you check out the code, you can find instructions on how to
-compile it in the [README](../README.md) file.
-
-## Testing ##
-
-A mocking framework is of no good if itself is not thoroughly tested.
-Tests should be written for any new code, and changes should be
-verified to not break existing tests before they are submitted for
-review. To perform the tests, follow the instructions in [README](../README.md) and
-verify that there are no failures.
-
-# Contributing Code #
-
-We are excited that Google Mock is now open source, and hope to get
-great patches from the community. Before you fire up your favorite IDE
-and begin hammering away at that new feature, though, please take the
-time to read this section and understand the process. While it seems
-rigorous, we want to keep a high standard of quality in the code
-base.
-
-## Contributor License Agreements ##
-
-You must sign a Contributor License Agreement (CLA) before we can
-accept any code. The CLA protects you and us.
-
- * If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](http://code.google.com/legal/individual-cla-v1.0.html).
- * If you work for a company that wants to allow you to contribute your work to Google Mock, then you'll need to sign a [corporate CLA](http://code.google.com/legal/corporate-cla-v1.0.html).
-
-Follow either of the two links above to access the appropriate CLA and
-instructions for how to sign and return it.
-
-## Coding Style ##
-
-To keep the source consistent, readable, diffable and easy to merge,
-we use a fairly rigid coding style, as defined by the [google-styleguide](https://github.com/google/styleguide) project. All patches will be expected
-to conform to the style outlined [here](https://google.github.io/styleguide/cppguide.html).
-
-## Submitting Patches ##
-
-Please do submit code. Here's what you need to do:
-
- 1. Normally you should make your change against the SVN trunk instead of a branch or a tag, as the latter two are for release control and should be treated mostly as read-only.
- 1. Decide which code you want to submit. A submission should be a set of changes that addresses one issue in the [Google Mock issue tracker](https://github.com/google/googletest/issues). Please don't mix more than one logical change per submittal, because it makes the history hard to follow. If you want to make a change that doesn't have a corresponding issue in the issue tracker, please create one.
- 1. Also, coordinate with team members that are listed on the issue in question. This ensures that work isn't being duplicated and communicating your plan early also generally leads to better patches.
- 1. Ensure that your code adheres to the [Google Mock source code style](#Coding_Style.md).
- 1. Ensure that there are unit tests for your code.
- 1. Sign a Contributor License Agreement.
- 1. Create a patch file using `svn diff`.
- 1. We use [Rietveld](http://codereview.appspot.com/) to do web-based code reviews. You can read about the tool [here](https://github.com/rietveld-codereview/rietveld/wiki). When you are ready, upload your patch via Rietveld and notify `googlemock@googlegroups.com` to review it. There are several ways to upload the patch. We recommend using the [upload\_gmock.py](../scripts/upload_gmock.py) script, which you can find in the `scripts/` folder in the SVN trunk.
-
-## Google Mock Committers ##
-
-The current members of the Google Mock engineering team are the only
-committers at present. In the great tradition of eating one's own
-dogfood, we will be requiring each new Google Mock engineering team
-member to earn the right to become a committer by following the
-procedures in this document, writing consistently great code, and
-demonstrating repeatedly that he or she truly gets the zen of Google
-Mock.
-
-# Release Process #
-
-We follow the typical release process for Subversion-based projects:
-
- 1. A release branch named `release-X.Y` is created.
- 1. Bugs are fixed and features are added in trunk; those individual patches are merged into the release branch until it's stable.
- 1. An individual point release (the `Z` in `X.Y.Z`) is made by creating a tag from the branch.
- 1. Repeat steps 2 and 3 throughout one release cycle (as determined by features or time).
- 1. Go back to step 1 to create another release branch and so on.
-
-
----
-
-This page is based on the [Making GWT Better](http://code.google.com/webtoolkit/makinggwtbetter.html) guide from the [Google Web Toolkit](http://code.google.com/webtoolkit/) project. Except as otherwise [noted](http://code.google.com/policies.html#restrictions), the content of this page is licensed under the [Creative Commons Attribution 2.5 License](http://creativecommons.org/licenses/by/2.5/).
diff --git a/googlemock/docs/Documentation.md b/googlemock/docs/Documentation.md
index a0311871..16083e70 100644
--- a/googlemock/docs/Documentation.md
+++ b/googlemock/docs/Documentation.md
@@ -11,5 +11,5 @@ the respective git branch/tag).**
To contribute code to Google Mock, read:
- * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch.
+ * [CONTRIBUTING](../CONTRIBUTING.md) -- read this _before_ writing your first patch.
* [Pump Manual](../../googletest/docs/PumpManual.md) -- how we generate some of Google Mock's source files.
diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h
index c446bf7d..3367a0b5 100644
--- a/googlemock/include/gmock/gmock-matchers.h
+++ b/googlemock/include/gmock/gmock-matchers.h
@@ -3615,6 +3615,10 @@ BoundSecondMatcher<Tuple2Matcher, Second> MatcherBindSecond(
return BoundSecondMatcher<Tuple2Matcher, Second>(tm, second);
}
+// Joins a vector of strings as if they are fields of a tuple; returns
+// the joined string. This function is exported for testing.
+GTEST_API_ string JoinAsTuple(const Strings& fields);
+
// Returns the description for a matcher defined using the MATCHER*()
// macro where the user-supplied description string is "", if
// 'negation' is false; otherwise returns the description of the
diff --git a/googlemock/src/gmock-spec-builders.cc b/googlemock/src/gmock-spec-builders.cc
index fc4968ba..93a83ae5 100644
--- a/googlemock/src/gmock-spec-builders.cc
+++ b/googlemock/src/gmock-spec-builders.cc
@@ -508,7 +508,7 @@ bool UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked()
return expectations_met;
}
-CallReaction intToCallReaction(int mock_behavior) {
+static CallReaction intToCallReaction(int mock_behavior) {
if (mock_behavior >= kAllow && mock_behavior <= kFail) {
return static_cast<internal::CallReaction>(mock_behavior);
}
diff --git a/googlemock/test/BUILD.bazel b/googlemock/test/BUILD.bazel
index 6e67f187..4c2df9e2 100644
--- a/googlemock/test/BUILD.bazel
+++ b/googlemock/test/BUILD.bazel
@@ -32,6 +32,8 @@
#
# Bazel Build for Google C++ Testing Framework(Google Test)-googlemock
+licenses(["notice"])
+
""" gmock own tests """
cc_test(
@@ -43,7 +45,8 @@ cc_test(
],
),
linkopts = select({
- "//:win": [],
+ "//:windows": [],
+ "//:windows_msvc": [],
"//conditions:default": [
"-pthread",
],
diff --git a/googlemock/test/gmock-internal-utils_test.cc b/googlemock/test/gmock-internal-utils_test.cc
index 72d9a854..c7893ae2 100644
--- a/googlemock/test/gmock-internal-utils_test.cc
+++ b/googlemock/test/gmock-internal-utils_test.cc
@@ -44,15 +44,7 @@
#include "gmock/internal/gmock-port.h"
#include "gtest/gtest.h"
#include "gtest/gtest-spi.h"
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// their code.
-#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
#if GTEST_OS_CYGWIN
# include <sys/types.h> // For ssize_t. NOLINT
diff --git a/googlemock/test/gmock-matchers_test.cc b/googlemock/test/gmock-matchers_test.cc
index 4beaec4c..5c764eb4 100644
--- a/googlemock/test/gmock-matchers_test.cc
+++ b/googlemock/test/gmock-matchers_test.cc
@@ -65,10 +65,6 @@
namespace testing {
-namespace internal {
-GTEST_API_ string JoinAsTuple(const Strings& fields);
-} // namespace internal
-
namespace gmock_matchers_test {
using std::greater;