diff --git a/format_test.cc b/format_test.cc index 34757456..5eeb9e81 100644 --- a/format_test.cc +++ b/format_test.cc @@ -751,3 +751,15 @@ TEST(ActiveFormatterTest, Example) { std::string path = "somefile"; ReportError("File not found: {0}") << path; } + +int main(int argc, char **argv) { +#ifdef _WIN32 + // 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(); +}