Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clearFilters() to doctest::Context #33

Closed
gunterfuchs opened this issue Sep 11, 2016 · 5 comments
Closed

Add clearFilters() to doctest::Context #33

gunterfuchs opened this issue Sep 11, 2016 · 5 comments

Comments

@gunterfuchs
Copy link

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
[email protected]

doctest.txt

@onqtam
Copy link
Member

onqtam commented Sep 11, 2016

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 Not an issue but feature I added. Add clearFilters() to doctest::Context Sep 13, 2016
@gunterfuchs
Copy link
Author

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,

Günter

@onqtam
Copy link
Member

onqtam commented Sep 15, 2016

integration with time stuff is planned in the roadmap :)

@onqtam
Copy link
Member

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?

@gunterfuchs
Copy link
Author

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

@onqtam onqtam closed this as completed in 31628ef Sep 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants