Commit 9547cf40 authored by Simon Marlow's avatar Simon Marlow
Browse files

Test for #7229

parent f81f4685
......@@ -30,3 +30,5 @@ test('4198',
test('3994', only_ways(['threaded1','threaded2']), compile_and_run, [''])
test('T4889', normal, compile_and_run, [''])
test('process009', if_os('mingw32', skip), compile_and_run, [''])
import Control.Monad
import System.Exit
import System.Process
import Data.Maybe
-- Test that we get the right exit code for processes that terminate
-- with a signal (#7229)
main = do
(_,_,_,p) <- createProcess (shell "kill -HUP $$")
waitForProcess p >>= print
getProcessExitCode p >>= print
(_,_,_,p) <- createProcess (shell "kill -HUP $$")
forever $ do
r <- getProcessExitCode p
if (isJust r) then do print r; exitWith ExitSuccess else return ()
ExitFailure 129
Just (ExitFailure 129)
Just (ExitFailure 129)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment