The main 4 developments are:
- moved to C++11 - motivated by the results from the poll in this reddit thread
-
thread-safety - asserts and logging utilities can be used in multiple threads spawned from a single test case without race conditions (thread sanitizer tested) - see example
- a complete overhaul of the internals of the framework (moving from printf-style logging to streams and changing internal structures) to allow for easier future development (including a reporter interface - work in progress)
- given that doctest is extremely light on compile times and is meant to be used for tests side-by-side with the production code - added the ability for asserts to be used outside of a testing context (as a general purpose assert library) - example
The move to C++11 allowed me to greatly simplify the codebase:
- removed a ton of preprocessor config options/detection for C++11 features (nullptr, deleted/defaulted functions, variadic macros, rvalue references, static assert, override, long long)
- using variadic templates where appropriate - mainly for templated test cases
- moved initialization of fields from initializer lists to class bodies
- using range-based for loops
- using lambdas
- using auto
- easily added portable thread-safety
Moving to C++11 also lead to dropping support for some old compilers:
- MSVC 2008, 2010, 2012, 2013 (supported: 2015+)
- GCC 4.4, 4.5, 4.6, 4.7 (supported: 4.8+)
- Clang 3.3, 3.4 (supported: 3.5+)
Use tag 1.2.9 for C++98 and older compilers.
Checkout the current Travis CI build matrix (and appveyor) for all supported compilers (still 180+ configurations tested - Debug/Release, address/undefined/thread sanitizers, valgrind, static analysis).
There is also a vaguely documented doctest::IReporter
interface for defining custom reporters (xml, TeamCity, whatever) and event listeners (test case started, assert passed, test run ended, etc.) - multiple reporters can be used at the same time.
The reporter system will be finalized for version 2.1.
Other developments:
- further improvement of compile and link times
- compilation and runtime benchmarks were updated
- the project gained a logo thanks to area55git
- support for clang-cl
see the changelog
download the header from here