Unit test framework

doctest is a new C++ testing framework but is by far the fastest both in compile times (by orders of magnitude) and runtime compared to other feature-rich alternatives. It brings the ability of compiled languages such as D / Rust / Nim to have tests written directly in the production code thanks to a fast, transparent and flexible test runner with a clean interface. - DOCtest

see also

DOCtest

doctest is modeled after Catch and some parts of the code have been taken directly - feature comparison:

  • (+) much faster to compile than catch below
  • (+) support meson build system
  • (+) subcase test (like catch2 scenarios).
  • (+) can be used alongside production code.
  • (+) decorators
  • (+) vscode integration through C++ TestMate

  • (-) missing Matchers

Catch2

a multi-paradigm test framework for C++. - Catch2 / v2 to v3 / The Coding Nest Command line

Google Test

Written on January 26, 2018, Last update on January 6, 2023
c++ test single-header