diff --git a/test/test-main.cc b/test/test-main.cc index 036394cd..9f5426ee 100644 --- a/test/test-main.cc +++ b/test/test-main.cc @@ -29,7 +29,13 @@ #ifdef _WIN32 # include +#endif + +#ifdef _MSC_VER # include +#else +# define _CrtSetReportFile(a, b) +# define _CrtSetReportMode(a, b) #endif int main(int argc, char **argv) { @@ -39,12 +45,12 @@ int main(int argc, char **argv) { // doesn't help. SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX); +#endif // Disable message boxes on assertion failures. _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); -#endif testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }