googletest README

The project's README from github.com/google/googletest. As one markdown file: README.md.

GoogleTest

Announcements

Documentation Updates

Our documentation is now live on GitHub Pages at https://google.github.io/googletest/. We recommend browsing the documentation on GitHub Pages rather than directly in the repository.

Release 1.18.0

Release 1.18.0 is now available.

The 1.18.x branch requires at least C++17.

Continuous Integration

We use Google's internal systems for continuous integration.

Coming Soon

Welcome to GoogleTest, Google's C++ test framework!

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

Getting Started

See the GoogleTest User's Guide for documentation. We recommend starting with the GoogleTest Primer.

More information about building GoogleTest can be found at googletest/README.md.

Features

Supported Platforms

GoogleTest follows Google's Foundational C++ Support Policy. See this table for a list of currently supported versions of compilers, platforms, and build tools.

Who Is Using GoogleTest?

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

GTest Runner is a Qt5 based automated test-runner and Graphical User Interface with powerful features for Windows and Linux platforms.

GoogleTest UI is a 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. GoogleTest UI is written in C#.

GTest TAP Listener is an event listener for GoogleTest that implements the TAP protocol for test result output. If your test runner understands TAP, you may find it useful.

gtest-parallel is a test runner that runs tests from your binary in parallel to provide significant speed-up.

GoogleTest Adapter is a VS Code extension allowing to view GoogleTest in a tree view and run/debug your tests.

C++ TestMate is a VS Code extension allowing to view GoogleTest in a tree view and run/debug your tests.

Cornichon is a small Gherkin DSL parser that generates stub code for GoogleTest.

Contributing Changes

Please read CONTRIBUTING.md for details on how to contribute to this project.

Happy testing!

googletest (google/googletest)

test-automation
Searching Database…

What is this?Google's testing and mocking framework for C++, built on the xUnit architecture. It merges the formerly separate GoogleTest and GoogleMock projects, which Google now maintains and releases together.
Is this a tool I run, or a library I link into my code?A framework you link into your C++ code, not a separate tool: tests are written in code, compiled into a test binary, and running that binary executes the suite.
How do I start writing tests with it?Read the GoogleTest Primer in the User's Guide — the team recommends the GitHub Pages docs over the in-repo copies. Build instructions live in googletest/README.md; release 1.18.0 is current.
Is my compiler new enough?It needs a C++17-capable compiler: the 1.18.x branch requires at least C++17. Otherwise you just build it from source per googletest/README.md — no other prerequisites are listed.
Is anything changing soon that might affect my build?One to watch: Google plans to take a dependency on Abseil, flagged as coming soon, so expect the framework to gain that dependency in a future release.
Who is using this in production?Many Google-internal projects, plus the Chromium projects behind Chrome and Chrome OS, the LLVM compiler, Protocol Buffers and the OpenCV library — it is battle-tested at massive scale.
Will it work on my platform?It builds and runs wherever the compilers and platforms in Google's Foundational C++ Support Policy are covered — the policy table lists exactly which compiler, platform and build-tool versions are supported.
What can its assertions check?Equality, inequality, exceptions and more out of the box, and you can define your own assertions for code-specific checks. Failures can be fatal or non-fatal, letting a test keep running after a non-fatal failure.
Can one test run against many inputs or data types?Yes — value-parameterized tests rerun with different input values, and type-parameterized tests run with different data types. Death tests verify that code exits in an expected way, useful for error-handling paths.
Can I run a single test, or everything in parallel?Both: GoogleTest offers options to run individual tests, run them in a specific order, or in parallel. Test discovery is automatic, so there is no manual registration list to maintain.
Are there editor integrations or companion tools?For VS Code there are GoogleTest Adapter and C++ TestMate to view, run and debug tests in a tree. Standalone runners include GTest Runner (Qt5 GUI for Windows and Linux), GoogleTest UI and gtest-parallel.
What are similar projects?testify, mockito, mockery, ava, Catch2, phpunit, msw, yoga
Creator
google
Size
13.9 MB
Stars
39.6K
Age
11y
Commits · 90 Days