When I use doctest with my Mac (up-to-date XCode :-), DOCTEST_BREAK_INTO_DEBUGGER is not defined.
Steps to reproduce :
Clone https://github.com/pthom/DocTest_LibTest and compile on a mac (cmake / make)
See for example
where I had to define it in order to avoid an error
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...
Actually I was using the make generator : just type cmake then make
Hope this helps
Same issue if I write cmake -DCMAKE_BUILD_TYPE=Debug or Release
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.
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.
fixed #22 - removed the #ifdef DEBUG part