blob: 675a216a4b37fc4300265f21d69481af582caa4c [file] [log] [blame] [view]
Google Code Exporterc3d82692015-08-24 18:41:02 -04001
Billy Donahue23bd6d82015-08-30 12:36:37 -04002# Google Test #
Billy Donahue3f4e79b2015-08-26 21:45:10 -04003
Billy Donahue604bd642015-08-31 09:43:03 -04004[![Build Status](https://travis-ci.org/google/googletest.svg?branch=master)](https://travis-ci.org/google/googletest)
5
Billy Donahuebf5753a2015-08-25 19:17:02 -04006Welcome to **Google Test**, Google's C++ test framework!
Google Code Exporterc3d82692015-08-24 18:41:02 -04007
Billy Donahue37b5c292015-08-26 18:28:20 -04008This repository is a merger of the formerly separate GoogleTest and
9GoogleMock projects. These were so closely related that it makes sense to
10maintain and release them together.
Google Code Exporterc3d82692015-08-24 18:41:02 -040011
Billy Donahue23bd6d82015-08-30 12:36:37 -040012Please see the project page above for more information as well as the
13mailing list for questions, discussions, and development. There is
14also an IRC channel on OFTC (irc.oftc.net) #gtest available. Please
15join us!
Billy Donahue37b5c292015-08-26 18:28:20 -040016
Billy Donahue23bd6d82015-08-30 12:36:37 -040017**Google Mock** is an extension to Google Test for writing and using C++ mock
18classes. See the separate [Google Mock documentation](googlemock/README.md).
19
Billy Donahueda25f9e2015-08-30 12:38:08 -040020More detailed documentation for googletest (including build instructions) are
21in its interior [googletest/README.md](googletest/README.md) file.
Billy Donahue23bd6d82015-08-30 12:36:37 -040022
23## Features ##
24
25 * An [XUnit](https://en.wikipedia.org/wiki/XUnit) test framework.
26 * Test discovery.
27 * A rich set of assertions.
28 * User-defined assertions.
29 * Death tests.
30 * Fatal and non-fatal failures.
31 * Value-parameterized tests.
32 * Type-parameterized tests.
33 * Various options for running the tests.
34 * XML test report generation.
Billy Donahue7563fe52015-08-25 17:56:57 -040035
Billy Donahue5b3ef3b2015-08-25 18:23:36 -040036## Platforms ##
Billy Donahue7563fe52015-08-25 17:56:57 -040037
Billy Donahue5b3ef3b2015-08-25 18:23:36 -040038Google test has been used on a variety of platforms:
39
40 * Linux
41 * Mac OS X
42 * Windows
43 * Cygwin
44 * MinGW
45 * Windows Mobile
46 * Symbian
Billy Donahue7563fe52015-08-25 17:56:57 -040047
48## Who Is Using Google Test? ##
49
50In addition to many internal projects at Google, Google Test is also used by
51the following notable projects:
52
Billy Donahue37b5c292015-08-26 18:28:20 -040053 * The [Chromium projects](http://www.chromium.org/) (behind the Chrome
54 browser and Chrome OS).
55 * The [LLVM](http://llvm.org/) compiler.
56 * [Protocol Buffers](http://code.google.com/p/protobuf/), Google's data
57 interchange format.
58 * The [OpenCV](http://opencv.org/) computer vision library.
Billy Donahue7563fe52015-08-25 17:56:57 -040059
Billy Donahue37b5c292015-08-26 18:28:20 -040060## Related Open Source Projects ##
Billy Donahue7563fe52015-08-25 17:56:57 -040061
Billy Donahued945d8c2015-08-27 10:26:17 -040062[Google Test UI](https://github.com/ospector/gtest-gbar) is test runner that runs
Billy Donahue5b3ef3b2015-08-25 18:23:36 -040063your test binary, allows you to track its progress via a progress bar, and
64displays a list of test failures. Clicking on one shows failure text. Google
65Test UI is written in C#.
Billy Donahue7563fe52015-08-25 17:56:57 -040066
Billy Donahue5b3ef3b2015-08-25 18:23:36 -040067[GTest TAP Listener](https://github.com/kinow/gtest-tap-listener) is an event
68listener for Google Test that implements the
69[TAP protocol](http://en.wikipedia.org/wiki/Test_Anything_Protocol) for test
70result output. If your test runner understands TAP, you may find it useful.
71
Billy Donahue23bd6d82015-08-30 12:36:37 -040072## Requirements ##
Billy Donahue5b3ef3b2015-08-25 18:23:36 -040073
Billy Donahue23bd6d82015-08-30 12:36:37 -040074Google Test is designed to have fairly minimal requirements to build
75and use with your projects, but there are some. Currently, we support
76Linux, Windows, Mac OS X, and Cygwin. We will also make our best
77effort to support other platforms (e.g. Solaris, AIX, and z/OS).
78However, since core members of the Google Test project have no access
79to these platforms, Google Test may have outstanding issues there. If
80you notice any problems on your platform, please notify
81<googletestframework@googlegroups.com>. Patches for fixing them are
82even more welcome!
Billy Donahue5b3ef3b2015-08-25 18:23:36 -040083
Billy Donahue23bd6d82015-08-30 12:36:37 -040084### Linux Requirements ###
Billy Donahue5b3ef3b2015-08-25 18:23:36 -040085
Billy Donahue23bd6d82015-08-30 12:36:37 -040086These are the base requirements to build and use Google Test from a source
87package (as described below):
Billy Donahue5b3ef3b2015-08-25 18:23:36 -040088
Billy Donahue23bd6d82015-08-30 12:36:37 -040089 * GNU-compatible Make or gmake
90 * POSIX-standard shell
91 * POSIX(-2) Regular Expressions (regex.h)
92 * A C++98-standard-compliant compiler
Billy Donahue5b3ef3b2015-08-25 18:23:36 -040093
Billy Donahue23bd6d82015-08-30 12:36:37 -040094### Windows Requirements ###
Billy Donahue3f4e79b2015-08-26 21:45:10 -040095
Billy Donahue23bd6d82015-08-30 12:36:37 -040096 * Microsoft Visual C++ v7.1 or newer
Billy Donahue5b3ef3b2015-08-25 18:23:36 -040097
Billy Donahue23bd6d82015-08-30 12:36:37 -040098### Cygwin Requirements ###
Billy Donahue5b3ef3b2015-08-25 18:23:36 -040099
Billy Donahue23bd6d82015-08-30 12:36:37 -0400100 * Cygwin v1.5.25-14 or newer
Billy Donahue5b3ef3b2015-08-25 18:23:36 -0400101
Billy Donahue23bd6d82015-08-30 12:36:37 -0400102### Mac OS X Requirements ###
Billy Donahue5b3ef3b2015-08-25 18:23:36 -0400103
Billy Donahue23bd6d82015-08-30 12:36:37 -0400104 * Mac OS X v10.4 Tiger or newer
105 * XCode Developer Tools
Billy Donahue5b3ef3b2015-08-25 18:23:36 -0400106
Billy Donahue23bd6d82015-08-30 12:36:37 -0400107### Requirements for Contributors ###
Billy Donahue5b3ef3b2015-08-25 18:23:36 -0400108
Billy Donahue23bd6d82015-08-30 12:36:37 -0400109We welcome patches. If you plan to contribute a patch, you need to
110build Google Test and its own tests from a git checkout (described
111below), which has further requirements:
Billy Donahue5b3ef3b2015-08-25 18:23:36 -0400112
Billy Donahue23bd6d82015-08-30 12:36:37 -0400113 * [Python](http://python.org/) v2.3 or newer (for running some of
114 the tests and re-generating certain source files from templates)
115 * [CMake](http://www.cmake.org/) v2.6.4 or newer
116
117## Regenerating Source Files ##
Billy Donahue5b3ef3b2015-08-25 18:23:36 -0400118
Billy Donahue37b5c292015-08-26 18:28:20 -0400119Some of Google Test's source files are generated from templates (not
Billy Donahueb55ac7f2015-08-30 12:13:33 -0400120in the C++ sense) using a script.
Billy Donahue23bd6d82015-08-30 12:36:37 -0400121For example, the
122file include/gtest/internal/gtest-type-util.h.pump is used to generate
123gtest-type-util.h in the same directory.
124
Billy Donahue37b5c292015-08-26 18:28:20 -0400125You don't need to worry about regenerating the source files
126unless you need to modify them. You would then modify the
127corresponding `.pump` files and run the '[pump.py](googletest/scripts/pump.py)'
Billy Donahue4af3c082015-08-26 18:29:25 -0400128generator script. See the [Pump Manual](googletest/docs/PumpManual.md).
Billy Donahue37b5c292015-08-26 18:28:20 -0400129
130### Contributing Code ###
131
Billy Donahue23bd6d82015-08-30 12:36:37 -0400132We welcome patches. Please read the
133[Developer's Guide](googletest/docs/DevGuide.md)
Billy Donahue37b5c292015-08-26 18:28:20 -0400134for how you can contribute. In particular, make sure you have signed
135the Contributor License Agreement, or we won't be able to accept the
136patch.
137
138Happy testing!