mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 12:14:26 +00:00
Move the Crash Reporter fix to Google Test where it belongs.
This commit is contained in:
parent
59a462c67d
commit
8cc0d21124
@ -6535,6 +6535,8 @@ void InitGoogleTest(int* argc, wchar_t** argv) {
|
||||
|
||||
# if GTEST_OS_MAC
|
||||
# include <crt_externs.h>
|
||||
# include <csignal>
|
||||
# include <cstdlib>
|
||||
# endif // GTEST_OS_MAC
|
||||
|
||||
# include <errno.h>
|
||||
@ -7337,6 +7339,11 @@ DeathTest::TestRole NoExecDeathTest::AssumeRole() {
|
||||
GTEST_DEATH_TEST_CHECK_(child_pid != -1);
|
||||
set_child_pid(child_pid);
|
||||
if (child_pid == 0) {
|
||||
#if GTEST_OS_MAC
|
||||
// This ensures that Crash Reporter is not invoked on death tests.
|
||||
std::signal(SIGABRT, std::exit);
|
||||
std::signal(SIGSEGV, std::exit);
|
||||
#endif
|
||||
GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[0]));
|
||||
set_write_fd(pipe_fd[1]);
|
||||
// Redirects all logging to stderr in the child process to prevent
|
||||
|
@ -26,8 +26,6 @@
|
||||
*/
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <csignal>
|
||||
#include <cstdlib>
|
||||
|
||||
#ifdef _WIN32
|
||||
# include <windows.h>
|
||||
@ -35,10 +33,7 @@
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
#if defined(__APPLE__)
|
||||
// This ensures that Crash Reporter is not invoked on death tests.
|
||||
std::signal(SIGABRT, std::exit);
|
||||
#elif defined(_WIN32)
|
||||
#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.
|
||||
|
Loading…
Reference in New Issue
Block a user