This library is free, 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:
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 by providing a fast, transparent and flexible test runner with a clean interface.
Tests can be considered a form of documentation and should be able to reside near the production code which they test.
doctest is modeled after Catch which is currently the most popular alternative for testing in C++ - check out the differences.
You can read more about it in the article of the february edition of ACCU Overload 2017.
Project:
Usage:
main()
entry pointSupport 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.
Want to see your name or the name of your company here? Consider donating!