Inspired by [jMock](http://www.jmock.org/), [EasyMock](http://www.easymock.org/), and [Hamcrest](http://code.google.com/p/hamcrest/), and
Welcome to **Google C++ Test Framework**!
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 Mock:
* lets you create mock classes trivially using simple macros,
This GitHub repository is a merger of the former <googletest> and <googlemock> products,
* supports a rich set of matchers and actions,
which are so closely related that it makes sense to maintain and release them together.
* handles unordered, partially ordered, or completely ordered expectations,
* is extensible by users, and
* works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and Symbian.
We hope you find it useful!
## GoogleTest ##
## Who are using Google Mock? ##
We have enjoyed using Google Mock in many projects at Google. Outside of Google, the most notable client is probably the [Chromium projects](http://www.chromium.org/)(behind the Chrome browser and Chrome OS). If you know of a project that's using Google Mock and want it to be listed here, please let
Based on the xUnit architecture. Supports automatic test discovery, a rich
`googlemock@googlegroups.com` know.
set of assertions, user-defined assertions, death tests, fatal and
non-fatal failures, value- and type-parameterized tests, various
options for running the tests, and XML test report generation.
## Platforms ##
## System Requirements ##
Google test has been used on a variety of platforms:
Google Mock is not a testing framework itself. Instead, it needs a
* Linux
testing framework for writing tests. Google Mock works seamlessly
* Mac OS X
with [Google Test](http://code.google.com/p/googletest/). It comes
* Windows
with a copy of Google Test bundled. Starting with version 1.1.0,
* Cygwin
you can also use it with [any C++ testing framework of your choice](ForDummies#Using_Google_Mock_with_Any_Testing_Framework.md).
* MinGW
* Windows Mobile
* Symbian
Google Mock has been tested with **gcc 4.0+** and **Microsoft Visual C++ 8.0 SP1**. Users
## Who Is Using Google Test? ##
reported that it also works with **gcc 3.4**, **Microsoft Visual C++ 7.1**, and **Cygwin**, although we haven't tested it there ourselves.
## Getting Started ##
In addition to many internal projects at Google, Google Test is also used by
the following notable projects:
If you are new to the project, we suggest to read the user
* The [Chromium projects](http://www.chromium.org/)(behind the Chrome browser and Chrome OS)
documentation in the following order:
* The [LLVM](http://llvm.org/) compiler
*[Protocol Buffers](http://code.google.com/p/protobuf/)(Google's data interchange format)
* The [OpenCV](http://opencv.org/) computer vision library
* Learn the [basics](http://code.google.com/p/googletest/wiki/Primer) of Google Test, if you choose to use Google Mock with it (recommended).
## Google Test-related open source projects ##
* Read [Google Mock for Dummies](ForDummies.md).
* Read the instructions on how to [build Google Mock](http://code.google.com/p/googlemock/source/browse/trunk/README).
You can also watch Zhanyong's [talk](http://www.youtube.com/watch?v=sYpCyLI47rM) on Google Mock's usage and implementation.
[Google Test UI](http://code.google.com/p/gtest-gbar/) is test runner that runs
your test binary, allows you to track its progress via a progress bar, and
displays a list of test failures. Clicking on one shows failure text. Google
Test UI is written in C#.
Once you understand the basics, check out the rest of the docs:
[GTest TAP Listener](https://github.com/kinow/gtest-tap-listener) is an event
listener for Google Test that implements the
[TAP protocol](http://en.wikipedia.org/wiki/Test_Anything_Protocol) for test
result output. If your test runner understands TAP, you may find it useful.
* CheatSheet - all the commonly used stuff at a glance.
## About Google Mock ##
* CookBook - recipes for getting things done, including advanced techniques.
If you need help, please check the KnownIssues and FrequentlyAskedQuestions before
**Google Mock** is an extension to Google Test for writing and using C++ mock classes.
posting a question on the [googlemock](http://groups.google.com/group/googlemock)
It is inspired by [jMock](http://www.jmock.org/), [EasyMock](http://www.easymock.org/),
discussion group.
and [Hamcrest](http://code.google.com/p/hamcrest/), and designed with C++'s specifics in mind.
We'd love to have your help! Please
Google mock:
read the DevGuide if you are willing to contribute to the development.
Happy mocking!
* lets you 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.
We hope you find it useful!
Google's framework for writing C++ tests on a variety of platforms
## Using Google Mock Without Google Test ##
(Linux, Mac OS X, Windows, Cygwin, Windows CE, and Symbian). Based on
Google Mock is not a testing framework itself. Instead, it needs a
the xUnit architecture. Supports automatic test discovery, a rich set
testing framework for writing tests. Google Mock works seamlessly
of assertions, user-defined assertions, death tests, fatal and
with [Google Test](http://code.google.com/p/googletest/), butj
non-fatal failures, value- and type-parameterized tests, various
you can also use it with [any C++ testing framework](googlemock/ForDummies.md#Using_Google_Mock_with_Any_Testing_Framework).
options for running the tests, and XML test report generation.
## Getting Started ##
## Getting Started ##
After downloading Google Test, unpack it, read the README file and the documentation wiki pages (listed on the right side of this front page).
If you are new to the project, we suggest that you read the user
documentation in the following order:
## Who Is Using Google Test? ##
* Learn the [basics](http://code.google.com/p/googletest/wiki/Primer) of Google Test, if you choose to use Google Mock with it (recommended).
* Read [Google Mock for Dummies](ForDummies.md).
* Read the instructions on how to [build Google Mock](http://code.google.com/p/googlemock/source/browse/trunk/README).
In addition to many internal projects at Google, Google Test is also used by
You can also watch Zhanyong's [talk](http://www.youtube.com/watch?v=sYpCyLI47rM) on Google Mock's usage and implementation.
the following notable projects:
* The [Chromium projects](http://www.chromium.org/)(behind the Chrome browser and Chrome OS)
Once you understand the basics, check out the rest of the docs:
* The [LLVM](http://llvm.org/) compiler
*[Protocol Buffers](http://code.google.com/p/protobuf/)(Google's data interchange format)
* The [OpenCV](http://opencv.org/) computer vision library
If you know of a project that's using Google Test and want it to be listed here, please let
*[CheatSheet](googlemock/docs/CheatSheet.md) - all the commonly used stuff at a glance.
`googletestframework@googlegroups.com` know.
*[CookBook](googlemock/docs/CookBook.md) - recipes for getting things done, including advanced techniques.
## Google Test-related open source projects ##
If you need help, please check the [KnownIssues](googlemock/docs/KnownIssues.md) and
[FrequentlyAskedQuestions](googlemock/docs/frequentlyaskedquestions.md) before
posting a question on the [googlemock discussion group](http://groups.google.com/group/googlemock).
[Google Test UI](http://code.google.com/p/gtest-gbar/) is test runner that runs your test binary, allows you to track its progress via a progress bar, and displays a list of test failures. Clicking on one shows failure text. Google Test UI is written in C#.
We'd love to have your help! Please read the Developer Guides if you are willing to contribute to the development.
[GTest TAP Listener](https://github.com/kinow/gtest-tap-listener) is an event listener for Google Test that implements the [TAP protocol](http://en.wikipedia.org/wiki/Test_Anything_Protocol) for test result output. If your test runner understands TAP, you may find it useful.