doctest/2.4.6+2

[brief]

The fastest feature-rich C++11/14/17/20 single-header testing framework for unit tests and TDD

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.

Standard License download CII Best Practices Language grade: C/C++ Join the chat at https://gitter.im/onqtam/doctest Try it online

The framework is and will stay free but needs your support to sustain its development. There are lots of new features and maintenance to do. If you work for a company using doctest or have the means to do so, please consider financial support. Monthly donations via Patreon and one-offs via PayPal.

A complete example with a self-registering test that compiles to an executable looks like this:

cover-example

There are many C++ testing frameworks - Catch, Boost.Test, UnitTest++, cpputest, googletest and many other.

The key differences between it and other testing frameworks are that it is light and unintrusive:

cost-of-including-the-framework-header

This allows the framework to be used in more ways than any other - tests can be written directly in the production code!

Tests can be considered a form of documentation and should be able to reside near the production code which they test.

The framework can be used like any other if you don't want/need to mix production code and tests - check out the features.

doctest is modeled after Catch and some parts of the code have been taken directly - check out the differences.

This table compares doctest / Catch / lest which are all very similar.

Checkout the CppCon 2017 talk on YouTube to get a better understanding of how the framework works and read about how to use it in the JetBrains article - highlighting the unique aspects of the framework! On a short description on how to use the framework along production code you could refer to this GitHub issue. There is also an older article in the february edition of ACCU Overload 2017.

CppCon 2017 talk about doctest on youtube

Documentation

Project:

Usage:

Contributing

Support the development of the project with donations! There is a list of planned features which are all important and big - see the roadmap. I took a break from working in the industry to make open source software so every cent is a big deal.

If you work for a company using doctest or have the means to do so, please consider financial support.

Contributions in the form of issues and pull requests are welcome as well - check out the Contributing page.

Stargazers over time

Stargazers over time

Logo

The logo is licensed under a Creative Commons Attribution 4.0 International License. Copyright © 2019 area55git   License: CC BY 4.0

version 2.4.6+2
license MIT
repository https://pkg.cppget.org/1/stable
download doctest-2.4.6+2.tar.gz
sha256 8795e3495430f05c770ffa362a0efa9216cd41669bcab3d68153e440fde3fd41
project doctest
url github.com/onqtam/doctest
package-url github.com/build2-packaging/doctest/
package-email lyrahgames@mailbox.org

Requires (1)

c++11 | c++14 | c++17 | c++20

Reviews

fail 0
pass 1

Builds

toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_17_libc++
timestamp 2025-08-23 09:59:26 UTC (01:34:13 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_17
timestamp 2025-08-23 09:47:05 UTC (01:46:34 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_13.1
timestamp 2025-08-23 09:44:27 UTC (01:49:12 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_fedora_40-gcc_14-bindist
timestamp 2025-08-22 21:37:41 UTC (13:55:58 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_14-static_O3
timestamp 2025-08-22 15:44:06 UTC (19:49:33 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_14-ndebug_O3
timestamp 2025-08-22 15:40:42 UTC (19:52:57 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_14-O3
timestamp 2025-08-22 15:40:10 UTC (19:53:29 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_14
timestamp 2025-08-22 15:35:31 UTC (19:58:08 hours ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_14-O3
timestamp 2025-08-21 04:46:36 UTC (02 06:47:03 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_14-static_O3
timestamp 2025-08-21 04:45:43 UTC (02 06:47:56 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_14-ndebug_O3
timestamp 2025-08-21 04:45:01 UTC (02 06:48:38 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_14
timestamp 2025-08-21 04:42:37 UTC (02 06:51:02 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.10-O2
timestamp 2025-08-21 03:49:49 UTC (02 07:43:50 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.10-static_O2
timestamp 2025-08-21 03:48:35 UTC (02 07:45:04 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.10
timestamp 2025-08-21 03:47:14 UTC (02 07:46:25 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_18_libc++-static_O3
timestamp 2025-08-20 21:18:44 UTC (02 14:14:55 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_18_libc++-O3
timestamp 2025-08-20 21:16:23 UTC (02 14:17:16 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_18_libc++
timestamp 2025-08-20 21:13:42 UTC (02 14:19:57 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_18-O3
timestamp 2025-08-20 21:12:36 UTC (02 14:21:03 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_18-static_O3
timestamp 2025-08-20 21:12:03 UTC (02 14:21:36 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_18
timestamp 2025-08-20 21:09:50 UTC (02 14:23:49 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-gcc_12-bindist
timestamp 2025-08-20 17:38:42 UTC (02 17:54:57 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-w64-mingw32
tgt config windows_10-gcc_13.2_mingw_w64-static_O2
timestamp 2025-08-20 17:37:32 UTC (02 17:56:07 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-w64-mingw32
tgt config windows_10-gcc_13.2_mingw_w64-O2
timestamp 2025-08-20 17:36:53 UTC (02 17:56:46 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-w64-mingw32
tgt config windows_10-gcc_13.2_mingw_w64
timestamp 2025-08-20 17:34:45 UTC (02 17:58:54 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-clang_18_llvm_msvc_17.10-static_O2
timestamp 2025-08-20 17:21:41 UTC (02 18:11:58 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-clang_18_llvm_msvc_17.10
timestamp 2025-08-20 17:19:30 UTC (02 18:14:09 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_ubuntu_24.04-gcc_13-bindist
timestamp 2025-08-20 17:19:21 UTC (02 18:14:18 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-clang_18_llvm_msvc_17.10-O2
timestamp 2025-08-20 17:18:36 UTC (02 18:15:03 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.8-O2
timestamp 2025-08-20 17:14:30 UTC (02 18:19:09 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.8-static_O2
timestamp 2025-08-20 17:14:30 UTC (02 18:19:09 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-msvc_17.8
timestamp 2025-08-20 17:13:43 UTC (02 18:19:56 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-microsoft-win32-msvc14.3
tgt config windows_10-clang_17_msvc_msvc_17.10
timestamp 2025-08-20 17:04:33 UTC (02 18:29:06 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-freebsd14.1
tgt config freebsd_14-clang_18-O3
timestamp 2025-08-20 16:58:16 UTC (02 18:35:23 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-freebsd14.1
tgt config freebsd_14-clang_18-static_O3
timestamp 2025-08-20 16:57:52 UTC (02 18:35:47 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-freebsd14.1
tgt config freebsd_14-clang_18
timestamp 2025-08-20 16:54:23 UTC (02 18:39:16 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-freebsd13.3
tgt config freebsd_13-clang_17
timestamp 2025-08-20 16:22:36 UTC (02 19:11:03 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_17_libc++
timestamp 2025-08-20 12:50:26 UTC (02 22:43:13 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-gcc_13
timestamp 2025-08-20 12:49:40 UTC (02 22:43:59 days ago)
result success | log | rebuild
toolchain public-0.17.0
target aarch64-linux-gnu
tgt config linux_debian_12-clang_17
timestamp 2025-08-20 12:49:10 UTC (02 22:44:30 days ago)
result success | log | rebuild
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_18
result unbuilt
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_18-O3
result unbuilt
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_18-static_O3
result unbuilt
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_18_libc++
result unbuilt
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_18_libc++-O3
result unbuilt
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_debian_12-clang_18_libc++-static_O3
result unbuilt
toolchain public-0.17.0
target x86_64-linux-gnu
tgt config linux_fedora_39-gcc_13-bindist
result unbuilt
toolchain public-0.17.0
target x86_64-apple-darwin22.5.0
tgt config macos_13-clang_15.0
result unbuilt
toolchain public-0.17.0
target x86_64-apple-darwin23.5.0
tgt config macos_14-clang_15.0
result unbuilt
toolchain public-0.17.0
target x86_64-apple-darwin23.5.0
tgt config macos_14-clang_15.0-O3
result unbuilt
toolchain public-0.17.0
target x86_64-apple-darwin23.5.0
tgt config macos_14-clang_15.0-static_O3
result unbuilt
toolchain public-0.17.0
target x86_64-apple-darwin23.5.0
tgt config macos_14-gcc_14_homebrew
result unbuilt
toolchain public-0.17.0
target x86_64-apple-darwin23.5.0
tgt config macos_14-gcc_14_homebrew-O3
result unbuilt
toolchain public-0.17.0
target x86_64-apple-darwin23.5.0
tgt config macos_14-gcc_14_homebrew-static_O3
result unbuilt

Changes

Change Log

2.4.6 (2021-03-22)

Full Changelog

Fixed bugs:

Closed issues:

Merged pull requests:

2.4.5 (2021-02-02)

Full Changelog

Closed issues:

Merged pull requests:

2.4.4 (2020-12-25)

Full Changelog

Closed issues:

2.4.3 (2020-12-16)

Full Changelog

2.4.2 (2020-12-15)

Full Changelog

Closed issues:

Merged pull requests:

2.4.1 (2020-11-04)

Full Changelog

Closed issues:

Merged pull requests:

2.4.0 (2020-06-27)

Full Changelog

Closed issues:

Merged pull requests:

2.3.8 (2020-05-17)

Full Changelog

Closed issues:

Merged pull requests:

2.3.7 (2020-02-24)

Full Changelog

Closed issues:

Merged pull requests:

2.3.6 (2019-12-16)

Full Changelog

Closed issues:

Merged pull requests:

2.3.5 (2019-09-22)

Full Changelog

Closed issues:

Merged pull requests:

2.3.4 (2019-08-12)

Full Changelog

Closed issues:

Merged pull requests:

2.3.3 (2019-06-02)

Full Changelog

Closed issues:

Merged pull requests:

2.3.2 (2019-05-06)

Full Changelog

Closed issues:

Merged pull requests:

2.3.1 (2019-03-24)

Full Changelog

Merged pull requests:

2.3.0 (2019-03-23)

Full Changelog

Closed issues:

Merged pull requests:

2.2.3 (2019-02-10)

Full Changelog

Closed issues:

2.2.2 (2019-01-28)

Full Changelog

Closed issues:

Merged pull requests:

2.2.1 (2019-01-15)

Full Changelog

Closed issues:

2.2.0 (2018-12-05)

Full Changelog

Closed issues:

2.1.0 (2018-11-30)

Full Changelog

Closed issues:

Merged pull requests:

2.0.1 (2018-10-24)

Full Changelog

Closed issues:

Merged pull requests:

2.0.0 (2018-08-23)

Full Changelog

Closed issues:

Merged pull requests:

1.2.9 (2018-05-10)

Full Changelog

Closed issues:

Merged pull requests:

1.2.8 (2018-03-10)

Full Changelog

Closed issues:

1.2.7 (2018-02-06)

Full Changelog

Closed issues:

Merged pull requests:

1.2.6 (2017-10-29)

Full Changelog

Closed issues:

Merged pull requests:

1.2.5 (2017-10-06)

Full Changelog

Closed issues:

1.2.4 (2017-09-20)

Full Changelog

Closed issues:

1.2.3 (2017-09-11)

Full Changelog

Closed issues:

1.2.2 (2017-09-05)

Full Changelog

Closed issues:

Merged pull requests:

1.2.1 (2017-05-24)

Full Changelog

Closed issues:

Merged pull requests:

1.2.0 (2017-05-15)

Full Changelog

Closed issues:

Merged pull requests:

1.1.4 (2017-02-18)

Full Changelog

Closed issues:

Merged pull requests:

1.1.3 (2016-11-15)

Full Changelog

Closed issues:

1.1.2 (2016-10-10)

Full Changelog

Closed issues:

1.1.1 (2016-09-22)

Full Changelog

1.1.0 (2016-09-21)

Full Changelog

Closed issues:

Merged pull requests:

1.0.0 (2016-05-22)

Merged pull requests:

* This Change Log was automatically generated by github_changelog_generator