# doctest/doctest

The fastest feature-rich C++11/14/17/20/23 single-header testing framework

Repository: https://github.com/doctest/doctest
Canonical: https://ross.abutalabs.com/products/doctest
Homepage: https://bit.ly/doctest-docs
Language: C++
License: MIT
License Family: permissive
Topics: c-plus-plus, doctest, tdd, testing, unit-testing, header-only, cpp, cpp11, cpp14, cpp17, cpp20, single-file, testing-framework, cpp23
Last push: 2026-08-18T21:43:01+00:00

## Health v2 (maintenance only)
Score: 92/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 80, longevity 100
- inputs: {"age_days": 4411, "days_push": 15, "days_rel": 58, "gap_med": 46.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6854, forks 698 (observed 2026-08-28T04:09:50.895762+00:00)

## What it is
doctest is a single-header C++ testing framework for unit tests and TDD, supporting C++11 through C++23. It is designed to be the fastest feature-rich option, with dramatically reduced compile times and the ability to write tests directly in production code files.

## Use cases
- write unit tests for C++ code with minimal compile-time overhead
- do test-driven development in C++ with tests inline in production source files
- replace heavyweight C++ test frameworks like GoogleTest or Catch2 for faster builds
- add a testing framework to a C++ project with just one header file
- run subcases and parameterized test cases in C++
- set up assertions and test fixtures in modern C++ (11-23)

## When to choose
- compile time of your test suite is a bottleneck
- you want a lightweight, header-only, unintrusive testing setup
- you want tests self-registering directly in production code like Rust or D unittests
- you need support for a wide range of C++ standards from C++11 to C++23

## When to avoid
- you need mocking frameworks or extensive ecosystem integrations out of the box
- your team already standardizes on GoogleTest or Catch2 with existing test infrastructure
- you need advanced features like property-based testing or built-in code coverage

## Facets
- artifact type: library
- maturity: stable
- function: testing, e2e-testing, benchmarking
- domain: testing, developer-tools
- platform: cpp, cross-platform, windows
- tags: header-only, unit-testing, tdd, single-header, test-framework, cpp11, cpp23, cpp, linux, macos

## Member repositories
- doctest/doctest (main) score 92

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:50.895762+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:41:45.085224+00:00, confidence not recorded.
  - readme: https://github.com/doctest/doctest (fetched 2026-08-28T04:09:50.895762+00:00, sha e6b393367076)
  - homepage: https://bit.ly/doctest-docs (fetched 2026-08-29T08:37:42.412594+00:00, sha 246d73dee1a0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
