GoogleTest: C++ testing and mocking framework
xUnit-based C++ testing framework with integrated mocking.
Learn more about GoogleTest
GoogleTest is a C++ unit testing framework based on the xUnit architecture that automates test discovery and execution. It is implemented in C++ and requires C++17 or later as of version 1.17.0. The framework supports both fatal and non-fatal test failures, value-parameterized tests with multiple input values, type-parameterized tests across different data types, and death tests for verifying program exit behavior. It is used in large-scale projects including Chromium, LLVM, Protocol Buffers, and OpenCV for validating C++ code correctness.
Unified Testing Framework
Combines unit testing and mocking in a single maintained codebase, eliminating the need to manage separate GoogleTest and GoogleMock dependencies. Simplifies build configuration and version compatibility for projects requiring both capabilities.
Parameterized Test Variants
Supports value-parameterized tests with different input values and type-parameterized tests across multiple data types. Reduces code duplication when testing functions with varying inputs or validating generic implementations.
Death Test Support
Verifies that code properly terminates under expected conditions by testing exit codes and error messages. Death tests ensure crash handlers and fatal error paths work correctly without crashing the test runner itself.
#include <gtest/gtest.h>
int Add(int a, int b) { return a + b; }
TEST(MathTest, AdditionWorks) {
EXPECT_EQ(Add(2, 3), 5);
EXPECT_EQ(Add(-1, 1), 0);
EXPECT_NE(Add(2, 2), 5);
}
int main(int argc, char **argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}Top in Developer Tools
Related Repositories
Discover similar tools and frameworks used by developers
Playwright
Cross-browser automation framework with built-in test runner.
Serena
Coding agent toolkit with semantic code retrieval and editing for LLMs via MCP server.
yt-dlp
Python CLI for downloading audio/video from thousands of websites, fork of youtube-dl.
Keiyoushi Extensions
Extension management for the Keiyoushi multi-source content aggregation platform.
ZXing
Multi-format 1D/2D barcode decoder in Java.
Related Reading
Guides and comparisons from the Greptile content library
Best AI Coding Tools for Solo Developers (2026 Review)
The best AI coding tools for solo developers in 2026, compared by where they fit in the software development lifecycle: writing code, prototyping, reviewing, testing, and background automation. Plus which tools fit which languages.
What is agentic coding? Benefits, risks, and best tools to consider
What engineering leaders need to know about agentic coding: how it differs from AI coding and vibe coding, how it works, the benefits and risks, and the tools worth evaluating.
API Security: What It Is, Why It Matters, and 7 Best Practices for 2026
What API security is, the OWASP API Security Top 10 risks with real examples from open source PRs, seven best practices to start with, and how to test your APIs with static scanning, dynamic testing, and runtime validation.
What is Source Code Management (SCM): Everything Engineering Leaders Need to Know
Source code management is more than branching and merging. Here is how SCM works, the top tools, the best practices, and why good code review is the foundation of source control in an agentic era.