Skip to content
  • Duncan Coutts's avatar
    Add tests for the top level exception handler · 2ec9734d
    Duncan Coutts authored
    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
    2ec9734d