This commit is contained in:
Dan Field 2020-09-30 14:38:44 -07:00 committed by GitHub
parent b493fa3af3
commit 9377073f34
3 changed files with 16 additions and 1 deletions

View File

@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "flutter/fml/backtrace.h"
#include "flutter/fml/build_config.h"
#include "flutter/fml/command_line.h"
#include "flutter/fml/logging.h"
@ -10,6 +11,7 @@
#include "flow_test_utils.h"
int main(int argc, char** argv) {
fml::InstallCrashHandler();
testing::InitGoogleTest(&argc, argv);
fml::CommandLine cmd = fml::CommandLineFromArgcArgv(argc, argv);

View File

@ -7,10 +7,15 @@
#include <cxxabi.h>
#include <dlfcn.h>
#include <execinfo.h>
#include <signal.h>
#include <csignal>
#include <sstream>
#if OS_WIN
#include <crtdbg.h>
#include <debugapi.h>
#endif
#include "flutter/fml/logging.h"
namespace fml {
@ -126,6 +131,12 @@ static void ToggleSignalHandlers(bool set) {
}
void InstallCrashHandler() {
#if OS_WIN
if (!IsDebuggerPresent()) {
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
}
#endif
ToggleSignalHandlers(true);
}

View File

@ -16,6 +16,7 @@
#include <cassert>
#include "flutter/fml/backtrace.h"
#include "flutter/fml/command_line.h"
#include "flutter/fml/icu_util.h"
#include "flutter/fml/logging.h"
@ -24,6 +25,7 @@
#include "txt_test_utils.h"
int main(int argc, char** argv) {
fml::InstallCrashHandler();
fml::CommandLine cmd = fml::CommandLineFromArgcArgv(argc, argv);
txt::SetCommandLine(cmd);
txt::SetFontDir(flutter::testing::GetFixturesPath());