README.md 3.76 KB
Newer Older
1

Billy Donahue's avatar
Billy Donahue committed
2
Welcome to **Google C++ Test Framework**!
3

Billy Donahue's avatar
Billy Donahue committed
4
5
This GitHub repository is a merger of the former <googletest> and <googlemock> products,
which are so closely related that it makes sense to maintain and release them together.
6

Billy Donahue's avatar
Billy Donahue committed
7
## GoogleTest ##
8

Billy Donahue's avatar
Billy Donahue committed
9
10
11
12
Based on the 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.
13

Billy Donahue's avatar
Billy Donahue committed
14
## Platforms ##
15

Billy Donahue's avatar
Billy Donahue committed
16
Google test has been used on a variety of platforms:
17

Billy Donahue's avatar
Billy Donahue committed
18
19
20
21
22
23
24
  * Linux
  * Mac OS X
  * Windows
  * Cygwin
  * MinGW
  * Windows Mobile
  * Symbian
25

Billy Donahue's avatar
Billy Donahue committed
26
## Who Is Using Google Test? ##
27

Billy Donahue's avatar
Billy Donahue committed
28
29
In addition to many internal projects at Google, Google Test is also used by
the following notable projects:
30

Billy Donahue's avatar
Billy Donahue committed
31
32
33
34
  * 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
35

Billy Donahue's avatar
Billy Donahue committed
36
## Google Test-related open source projects ##
37

Billy Donahue's avatar
Billy Donahue committed
38
39
40
41
[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#.
42

Billy Donahue's avatar
Billy Donahue committed
43
44
45
46
[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.
47

Billy Donahue's avatar
Billy Donahue committed
48
## About Google Mock ##
49

Billy Donahue's avatar
Billy Donahue committed
50
51
52
**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.
53

Billy Donahue's avatar
Billy Donahue committed
54
Google mock:
55

Billy Donahue's avatar
Billy Donahue committed
56
57
58
59
  * 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.
60

Billy Donahue's avatar
Billy Donahue committed
61
We hope you find it useful!
62

Billy Donahue's avatar
Billy Donahue committed
63
64
65
66
67
## 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).
68
69
70

## Getting Started ##

Billy Donahue's avatar
Billy Donahue committed
71
72
If you are new to the project, we suggest that you read the user
documentation in the following order:
73

Billy Donahue's avatar
Billy Donahue committed
74
75
76
  * 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).
77

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

Billy Donahue's avatar
Billy Donahue committed
80
Once you understand the basics, check out the rest of the docs:
81

Billy Donahue's avatar
Billy Donahue committed
82
83
  * [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.
84

Billy Donahue's avatar
Billy Donahue committed
85
86
87
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).
88

Billy Donahue's avatar
Billy Donahue committed
89
We'd love to have your help! Please read the Developer Guides if you are willing to contribute to the development.
90

Billy Donahue's avatar
Billy Donahue committed
91
Happy mocking!