Add tests for the top level exception handler
authorDuncan Coutts <duncan@well-typed.com>
Thu, 14 Nov 2013 15:16:30 +0000 (15:16 +0000)
committerDuncan Coutts <duncan@well-typed.com>
Thu, 14 Nov 2013 15:36:49 +0000 (15:36 +0000)
commitdd0000410efef9fe92375475f93e43d2ad3e4492
tree1e7fe4543839044f2ad1a19b5c3e14f6238ce929
parent6b22a6ef9e59c6562ef6adfad7cd94e27aedec2c
Add tests for the top level exception handler

The top level exception handler is wrapped around main, and FFI exports.
It handles exceptions that are not otherwise caught in user code. For
most exception is just prints them, but handles a few specially,
including ExitCode and UserInterrupt.

On Unix it installs a signal handler for SIGINT to translate it into a
UserInterrupt async exception.

So we test that:

1. receiving SIGINT does trigger a UserInterrupt async exception
2. an unhandled UserInterrupt makes us kill ourselves with SIGINT
3. an unhandled ExitFailure (-sig) makes us kill ourselves with sig
tests/all.T
tests/topHandler01.hs [new file with mode: 0644]
tests/topHandler01.stdout [new file with mode: 0644]
tests/topHandler02.hs [new file with mode: 0644]
tests/topHandler03.hs [new file with mode: 0644]