Doctest 2 released! Moved to C++11 -- Viktor Kirilov

Save to:
Instapaper Pocket Readability

Writing unit tests in C++ has never been easier and faster.

    Doctest 2 released! C++11, thread-safety, stand-alone assertions and more!

by Viktor Kirilov

From the article:

The main 4 developments are:

  • moved to C++11 => greatly simplified the codebase
  • 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
  • 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
  • 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)

Add a Comment

You must sign in or register to add a comment.

Comments (1)

0 0

Paxen said on Aug 24, 2018 12:41 AM:

Viktor, I find doctest very useful and I'm migrating to it bit by bit from boost. Updating to doctest 2 was painless, I only had to remove Types<> in my DOCTEST_TEST_CASE_TEMPLATE lines.

You chose not to specialise the destination of the type list to also handle Types< ... >? It would make upgrading transparent.