aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 158bd555dbdc4839b1c1419551cc940eaf8ce083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Welcome to **Google Test**, Google's C++ test framework!

This GitHub repository is a merger of the formerly separate GoogleTest and GoogleMock projects.
These were so closely related that it makes sense to maintain and release them together.

## GoogleTest ##

Based on the [XUnit](https://en.wikipedia.org/wiki/XUnit) architecture.
Supports automatic test discovery, a rich 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 ##

Google test has been used on a variety of platforms:

  * Linux
  * Mac OS X
  * Windows
  * Cygwin
  * MinGW
  * Windows Mobile
  * Symbian

## Who Is Using Google Test? ##

In addition to many internal projects at Google, Google Test is also used by
the following notable projects:

  * The [Chromium projects](http://www.chromium.org/) (behind the Chrome browser and Chrome OS)
  * 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

## Google Test-related open source projects ##

[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#.

[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.

## About Google Mock ##

**Google Mock** is an extension to Google Test for writing and using C++ mock classes.
It is inspired by [jMock](http://www.jmock.org/), [EasyMock](http://www.easymock.org/),
and [Hamcrest](http://code.google.com/p/hamcrest/), and designed with C++'s specifics in mind.

Google mock:

  * 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!

## Using Google Mock Without Google Test ## 
Google Mock is not a testing framework itself.  Instead, it needs a
testing framework for writing tests.  Google Mock works seamlessly
with [Google Test](http://code.google.com/p/googletest/), butj
you can also use it with [any C++ testing framework](googlemock/ForDummies.md#Using_Google_Mock_with_Any_Testing_Framework).

## Getting Started ##

If you are new to the project, we suggest that you read the user
documentation in the following order:

  * 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).

You can also watch Zhanyong's [talk](http://www.youtube.com/watch?v=sYpCyLI47rM) on Google Mock's usage and implementation.

Once you understand the basics, check out the rest of the docs:

  * [CheatSheet](googlemock/docs/CheatSheet.md) - all the commonly used stuff at a glance.
  * [CookBook](googlemock/docs/CookBook.md) - recipes for getting things done, including advanced techniques.

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).

We'd love to have your help! Please read the Developer Guides if you are willing to contribute to the development.

Happy mocking!