diff --git a/test/test-main.cc b/test/test-main.cc index f4f2e789..036394cd 100644 --- a/test/test-main.cc +++ b/test/test-main.cc @@ -28,11 +28,17 @@ #include #ifdef _WIN32 +# include # include #endif int main(int argc, char **argv) { #ifdef _WIN32 + // Don't display any error dialogs. This also suppresses message boxes + // on assertion failures in MinGW where _set_error_mode/CrtSetReportMode + // doesn't help. + SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | + SEM_NOOPENFILEERRORBOX); // Disable message boxes on assertion failures. _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);