mity / acutest

Simple header-only C/C++ unit testing facility.
MIT License
346 stars 96 forks source link

Windows outputs "Debug Error - Abort() was called" on every failed test #42

Closed ataulien closed 4 years ago

ataulien commented 4 years ago

When compiling with MSVC, Windows outputs this on every failing test:

image

This can easily be disabled by calling the following (See MSDN):

_set_abort_behavior(0, _WRITE_ABORT_MSG);

I'm just not sure where, otherwise this would be a PR!

An other solution would be to simply not use abort() on windows, but a special exit-code.

mity commented 4 years ago

Thanks. I'll take a look at it.

However, are you sure it is for every failing test? abort() is only used if TEST_ASSERT() fails. When the test sticks to TEST_CHECK(), the test continues but will eventually exit with non-zero (when assuming the default behavior without --no-exec; with --no-exec the test is just a function call).

ataulien commented 4 years ago

Ah, you're right, I should really be using TEST_CHECK! Thanks for the reminder!