Disable message boxes on assertion failures.

This commit is contained in:
Victor Zverovich 2012-12-16 15:20:01 -08:00
parent d53f209626
commit 4226b64c7d

View File

@ -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();
}