catchorg/Catch2
Developer ToolsC++ unit testing and micro-benchmarking framework for developers using C++14 and later.
Overview
Catch2 is a C++-native test framework for unit tests, TDD, and BDD-style tests. Assertions are written as ordinary C++ boolean expressions, test names do not need to be valid identifiers, and sections let a test share setup and teardown code locally. The framework also includes basic micro-benchmarking and simple BDD macros, so a project can cover correctness checks and small performance measurements with one library (3).
The devel branch develops Catch2 v3, which is no longer a single-header library: it is distributed as a normal library with multiple headers and a separately compiled implementation. Projects still on v2 can use the v2.x branch. The project is aimed at C++ developers working with C++14 or C++17 and later.
Quick start
A test file includes the test macros header and uses TEST_CASE with REQUIRE assertions, for example checking factorials (3):
#include <catch2/catch_test_macros.hpp>
#include <cstdint>
uint32_t factorial( uint32_t number ) {
return number <= 1 ? number : factorial(number-1) * number;
}
TEST_CASE( "Factorials are computed", "[factorial]" ) {
REQUIRE( factorial( 1) == 1 );
REQUIRE( factorial( 2) == 2 );
REQUIRE( factorial( 3) == 6 );
REQUIRE( factorial(10) == 3'628'800 );
}
Micro-benchmarks use BENCHMARK inside a test case tagged [!benchmark]; benchmarks are not run by default and require that tag to be selected explicitly (3).
For a full setup walkthrough, including fetching or installing the v3 library and compiling a test executable, the tutorial is the maintained starting point. The repository README does not show the build-system integration commands itself, so follow the tutorial rather than guessing them.
Use constraints
Catch2 v3 targets C++14 and later; C++11 belongs to the v2.x branch and C++03 to the older Catch1.x branch (3). Because v3 is a compiled library rather than single-header, projects must build or link it as a library instead of dropping one header into the source tree. Upgrading from v2 requires following the migration guide, which collects the main breaking changes.
The project is released under BSL-1.0 (1). The README points to the issue tracker for bug reports and to Discord for discussion and questions (2).
HotRepo's take
Catch2 appears in HotRepo's daily all-language snapshots in July 2026, recording 69 stars on July 10, 117 on July 11, and 113 on July 12. A later November 12 snapshot places it 15th on the C++ daily list with 12 stars gained that day (1). These are separate daily observations rather than a continuous trend, but they show the framework still receiving attention in C++ tooling discussions. With a long history dating to 2010 and a large user base, the more relevant adoption question for a team is the v3 library-style integration and migration cost from v2, not whether the project is active.
Written by AI from the project's README, updated . The project's own docs are the source of truth.