commit | e70848d9249c6e96a4d0e2912a7f03f9e6e75c12 | [log] [tgz] |
---|---|---|
author | onqtam <vik.kirilov@gmail.com> | Mon Mar 13 22:34:34 2017 +0200 |
committer | onqtam <vik.kirilov@gmail.com> | Tue May 16 00:22:13 2017 +0300 |
tree | b956503410974a5fcdfe3654435c09a59a213abf | |
parent | 4d8c72d1afe89e1450dcb1e757953f64f37a588c [diff] |
forgot to export a global function - because written inside of the class as a friend... relates #55
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!