Add clearFilters() to doctest::Context #33

gunterfuchs opened this Issue Sep 11, 2016 · 5 comments


None yet

2 participants


I just wanted to let you know that doctest works great for me running on an Analog Devices ADSP21479 SHARC MCU. For that to work I had to add this macro to my build: DOCTEST_CONFIG_COLORS_NONE and _LIBCPP_VERSION.

Since I am running the tests menu driven (The Analog Devices Eclipse based CrossCore Embedded Studio 2.3.0 allows printf / scanf through the Eclipse Console.) I also created my own main function (DOCTEST_CONFIG_IMPLEMENT). Because doctest is not geared towards menu driven test I added one function to the code which allows me to run only one test the user has chosen from the menu. If you like to incorporate it into the next version, please go ahead. The function just clears the filter vectors.

BTW, it takes a few seconds to compile doctest under the Analog Devices compiler (_ADI_COMPILER) on my decently fast Windows 7 PC.

Thanks for the great work,

Günter Fuchs


onqtam commented Sep 11, 2016 edited

about the long compilation times - the source file where doctest gets implemented is always slow.
For source files that only use doctest and many assertions - compile time performance will be improved quite a lot with the upcoming 1.1 release.

about _LIBCPP_VERSION - weird - I do #include <ciso646> for clang in order to get _LIBCPP_VERSION defined so I can detect if clang is using libstdc++ (from g++) or libc++.

Including any system header under clang should result in _LIBCPP_VERSION being defined if libc++ is used

Is the ADI compiler based on clang? or g++? If it is g++ then defining DOCTEST_CONFIG_USE_IOSFWD would be better than _LIBCPP_VERSION.

about the filter clearing feature - yes, I will add it - it seems useful.

Thanks for using the library!

@onqtam onqtam changed the title from Not an issue but feature I added. to Add clearFilters() to doctest::Context Sep 13, 2016

Hi Viktor,

thanks for your advice about using DOCTEST_CONFIG_USE_IOSFWD instead of _LIBCPP_VERSION. That worked.

A time stamping feature when logging would be nice using time.h for example.

Best wishes,


onqtam commented Sep 15, 2016

integration with time stuff is planned in the roadmap :)

onqtam commented Sep 15, 2016

Actually can you post me the error message when not using DOCTEST_CONFIG_USE_IOSFWD so I can put an entry in the FAQ about it?


The compiler stops at 100 errors. I have attached the build output.

@onqtam onqtam closed this in 31628ef Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment