Revert "Suppress assert dialog boxes when running CI tests"

This reverts commit 3574bcacca.
This commit is contained in:
Kevin Sawicki 2017-07-17 10:05:21 -07:00
parent fa7c006a3d
commit 968759b823

View file

@ -34,7 +34,7 @@
namespace { namespace {
const auto kRunAsNode = "ELECTRON_RUN_AS_NODE"; const char* kRunAsNode = "ELECTRON_RUN_AS_NODE";
bool IsEnvSet(const char* name) { bool IsEnvSet(const char* name) {
#if defined(OS_WIN) #if defined(OS_WIN)
@ -56,30 +56,6 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t* cmd, int) {
bool run_as_node = IsEnvSet(kRunAsNode); bool run_as_node = IsEnvSet(kRunAsNode);
#ifdef _DEBUG
// Don't display assert dialog boxes in CI test runs
static const auto kCI = "ELECTRON_CI";
bool is_ci = IsEnvSet(kCI);
if (!is_ci) {
for (int i = 0; i < argc; ++i) {
if (!_wcsicmp(wargv[i], L"--ci")) {
is_ci = true;
_putenv_s(kCI, "1"); // set flag for child processes
break;
}
}
}
if (is_ci) {
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG | _CRTDBG_MODE_FILE);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
_set_error_mode(_OUT_TO_STDERR);
}
#endif
// Make sure the output is printed to console. // Make sure the output is printed to console.
if (run_as_node || !IsEnvSet("ELECTRON_NO_ATTACH_CONSOLE")) if (run_as_node || !IsEnvSet("ELECTRON_NO_ATTACH_CONSOLE"))
base::RouteStdioToConsole(false); base::RouteStdioToConsole(false);