Make sure that Crash Reporter is not invoked on death tests.

This commit is contained in:
Victor Zverovich 2014-08-23 10:04:06 -07:00
parent 45397e5046
commit 59a462c67d

View File

@ -26,6 +26,8 @@
*/ */
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <csignal>
#include <cstdlib>
#ifdef _WIN32 #ifdef _WIN32
# include <windows.h> # include <windows.h>
@ -33,7 +35,10 @@
#endif #endif
int main(int argc, char **argv) { int main(int argc, char **argv) {
#ifdef _WIN32 #if defined(__APPLE__)
// This ensures that Crash Reporter is not invoked on death tests.
std::signal(SIGABRT, std::exit);
#elif defined(_WIN32)
// Don't display any error dialogs. This also suppresses message boxes // Don't display any error dialogs. This also suppresses message boxes
// on assertion failures in MinGW where _set_error_mode/CrtSetReportMode // on assertion failures in MinGW where _set_error_mode/CrtSetReportMode
// doesn't help. // doesn't help.