GoogleTest is Google’s C++ framework for writing tests and creating mocks. It supports many kinds of C++ testing, not only unit tests, and uses an xUnit-style architecture. Tests are discovered and run without manual registration. Its assertions cover equality, inequality, exceptions and other conditions, and users can define their own assertions. Failure options include fatal and non-fatal test failures, as well as death tests. Developers can create value-parameterized and type-parameterized tests, choose individual tests or their order, and run tests in parallel. GoogleTest provides quickstarts for Bazel and CMake, plus pkg-config files for compiling and linking GoogleTest and GoogleMock. The user guide includes introductory and advanced material, mocking guides, FAQs, references, samples and community documentation. It supports Linux, macOS and Windows; the 1.18.x branch requires at least C++17. GoogleTest is free under the BSD-3-Clause license, which permits source and binary redistribution subject to its conditions and disclaimer.
Who it is for
It suits C++ developers who need to test varied code, create mocks, or run parameterized tests. Its Bazel and CMake quickstarts and support for Linux, macOS and Windows may help teams using those environments.
What is good
- Discovers and runs tests without manual registration.
- Supports fatal, non-fatal and death tests.
- Provides value- and type-parameterized tests.
- Can run tests in parallel.
- Free under the BSD-3-Clause license.
What to know first
- The 1.18.x branch requires at least C++17.
- Supports C++ only.
Verdict
GoogleTest offers a broad set of C++ testing and mocking capabilities, from automatic test discovery to parallel execution. Check the published compiler, platform and build-tool versions, and note the C++17 requirement for the 1.18.x branch.
GoogleTest plans and pricing
All plansCompared on unit testing frameworks
- Free plan
- Yes
- Supported languages
- C++
- Built-in mocks
- Yes
- Parameterized cases
- Yes
- Parallel execution
- Yes




