pthom opened this Issue Jun 4, 2016 · 7 comments


None yet

4 participants

pthom commented Jun 4, 2016


When I use doctest with my Mac (up-to-date XCode :-), DOCTEST_BREAK_INTO_DEBUGGER is not defined.

Steps to reproduce :
Clone and compile on a mac (cmake / make)

See for example
where I had to define it in order to avoid an error

Thanks !

onqtam commented Jun 4, 2016 edited

my guess is that DEBUG (see here) isn't defined when xcode is used as the generator - a friend already told me about this - I hadn't tested it - will fix. This was taken directly from Catch so I supposed it would work for OSX...

pthom commented Jun 4, 2016

Actually I was using the make generator : just type cmake then make
Hope this helps

pthom commented Jun 4, 2016

Same issue if I write cmake -DCMAKE_BUILD_TYPE=Debug or Release

pthom commented Jun 4, 2016

If I define DEBUG it will work.
However, my guess is that cmake defines NDEBUG for release builds, and nothing for debug builds (which is unfortunate). May be this should go in the readme.


ongamex commented Jun 4, 2016 edited

Hmm, "NDEBUG" should be defined for non-debug builds under clang and gcc if remember correctly.


Wrapping DOCTEST_BREAK_INTO_DEBUGGER in a #ifdef DEBUG is really unnecessary, since the extra code generated when defined is very small, while not defining it makes it a pain to use. People do run optimized code under debuggers. In other words, this is but a useless premature optimization. Yes, Catch does it, and that is equally pointless.


In fact, the DEBUG guard is only present for OS X targets, but not Windows and Linux targets. An inconsistent design.

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