Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s specifics in mind, Google C++ Mocking Framework (or Google Mock for short) is a library for writing and using C++ mock classes.
Google C++ Mocking Framework is not a testing framework itself. Instead, it needs a testing framework for writing tests. Google Mock works seamlessly with Google Test.
Google C++ Mocking Framework comes with a copy of Google C++ Testing Framework 1.3.0 bundled, or you can use a compatible version that you have already installed. Starting with version 1.1.0, you can also use it with any C++ testing framework of your choice.
Google C++ Mocking Framework has been tested with gcc 4.0+ on Mac OS X and Linux, and Microsoft Visual C++ 8.0 SP1 on Windows. Users reported that the Google C++ Mocking Framework also works with gcc 3.4 and Cygwin.
NOTE: Google C++ Mocking Framework is licensed and provided under the terms of the New BSD License.
Here are some key features of "Google C++ Mocking Framework":
· Create mock classes trivially using simple macros
· Supports a rich set of matchers and actions
· Handles unordered, partially ordered, or completely ordered expectations
· Is extensible by users
· Works on Mac OS X, Linux, and Windows
What's New in This Release: [ read full changelog ]
· Compilation is much faster and uses much less memory, especially when the constructor and destructor of a mock class are moved out of the class body.
· New matchers: Pointwise(), Each().
· New actions: ReturnPointee() and ReturnRefOfCopy().
· CMake support.
· Project files for Visual Studio 2010.
· AllOf() and AnyOf() can handle up-to 10 arguments now.
· Google Mock doctor understands Clang error messages now.
· SetArgPointee now accepts string literals.
· gmock_gen.py handles storage specifier macros and template return types now.
· Compatibility fixes.
· Bug fixes and implementation clean-ups.
· Potentially incompatible changes: disables the harmful 'make install' command in autotools.
Potentially breaking changes:
· The description string for MATCHER*() changes from Python-style interpolation to an ordinary C++ string expression.
· SetArgumentPointee is deprecated in favor of SetArgPointee.
· Some non-essential project files for Visual Studio 2005 are removed.