commit | 192068c8240ba8b2c9e34040ada65ca393893ebf | [log] [tgz] |
---|---|---|
author | onqtam <vik.kirilov@gmail.com> | Mon May 15 20:29:57 2017 +0300 |
committer | onqtam <vik.kirilov@gmail.com> | Tue May 16 00:22:27 2017 +0300 |
tree | a93997a42485e4e479a70341589da4d4e001cfd0 | |
parent | 1b63b5a253bc5e78bf6afd4e94c71afa228d7abd [diff] |
remade 2 of the screenshots because of the "press F11 to exit fullscreen" unfaded text from the previous ones :D
master branch | Linux/OSX | Windows | ||
---|---|---|---|---|
dev branch | Linux/OSX | Windows |
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.
The doctest library is inspired by the unittest {}
functionality of the D programming language and Python's docstrings - tests can be considered a form of documentation and should be able to reside near the production code which they test.
A complete example with a self-registering test that compiles to an executable looks like this:
Note how a standard C++ operator for equality comparison is used - doctest has one core assertion macro (it also has for less than, equals, greater than...) - yet the full expression is decomposed and the left and right values are logged.
It is modeled after Catch which is currently the most popular alternative for testing in C++ - check out the differences.
There are many C++ testing frameworks - Catch, Boost.Test, UnitTest++, cpputest, googletest and many other.
What makes doctest different is that it is ultra light on compile times (by orders of magnitude) and is unintrusive.
The key differences between it and other testing libraries are:
DOCTEST_CONFIG_DISABLE
identifierdoctest
namespace) and doesn't drag any headers with itThis allows the framework to be used in more ways than any other - tests can be written directly in the production code!
The library can be used like any other if you don't like the idea of mixing production code and tests - check out the features
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.
Project:
Usage:
main()
entry pointWant to see your name or the name of your company here? Consider donating!