Work around Cygwin's crash-suppression behavior
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Feb 2011 18:45:10 +0000 (18:45 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 25 Feb 2011 18:45:10 +0000 (18:45 +0000)
commit77644c0af05b477ecc0624ae545be2cc37b52de5
tree60b80535c2c9e690dcfd1bb23f86c40bed479799
parentd50cdcbd2c6c6f9936794aab4d1d0fcbaa104ad9
Work around Cygwin's crash-suppression behavior

Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which any processes it launches will
inherit. This is bad for testing/debugging, as it causes the post-mortem debugger not to be
invoked. (Cygwin does this because it makes crashes more UNIX-y.) We reset the error mode
when our test apps launch to work around Cygwin's behavior.

Fixes <http://webkit.org/b/55222> Test apps crash silently (without invoking post-mortem
debugger) when launched from Cygwin 1.7

Reviewed by Darin Adler.

Source/JavaScriptCore:

* API/tests/testapi.c: Added a now-needed #include.
(main):
* jsc.cpp:
(main):
Call ::SetErrorMode(0) to undo Cygwin's folly.

* JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Define NOMINMAX like many of our
other projects do so that windows.h won't define min/max macros that interfere with
std::numeric_limits<T>::min/max.

Tools:

* DumpRenderTree/win/DumpRenderTree.cpp:
(main):
* TestWebKitAPI/win/main.cpp:
(main):
* WebKitAPITest/main.cpp:
(main):
* WebKitTestRunner/win/TestControllerWin.cpp:
(WTR::TestController::platformInitialize):
Call ::SetErrorMode(0) to undo Cygwin's folly.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@79695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/API/tests/testapi.c
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/JavaScriptCore.vcproj/testapi/testapiCommon.vsprops
Source/JavaScriptCore/jsc.cpp
Tools/ChangeLog
Tools/DumpRenderTree/win/DumpRenderTree.cpp
Tools/TestWebKitAPI/win/main.cpp
Tools/WebKitAPITest/main.cpp
Tools/WebKitTestRunner/win/TestControllerWin.cpp