Repository : ssh://darcs.haskell.org//srv/darcs/packages/process On branch : master
http://hackage.haskell.org/trac/ghc/changeset/9547cf40ac1ddcd471a8ce75f927b382a82c1038 >--------------------------------------------------------------- commit 9547cf40ac1ddcd471a8ce75f927b382a82c1038 Author: Simon Marlow <[email protected]> Date: Mon Sep 24 12:11:14 2012 +0100 Test for #7229 >--------------------------------------------------------------- tests/all.T | 2 ++ tests/process009.hs | 18 ++++++++++++++++++ tests/process009.stdout | 3 +++ 3 files changed, 23 insertions(+), 0 deletions(-) diff --git a/tests/all.T b/tests/all.T index 5d53d0b..5d621ce 100644 --- a/tests/all.T +++ b/tests/all.T @@ -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, ['']) diff --git a/tests/process009.hs b/tests/process009.hs new file mode 100644 index 0000000..7cd4c39 --- /dev/null +++ b/tests/process009.hs @@ -0,0 +1,18 @@ +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 () + diff --git a/tests/process009.stdout b/tests/process009.stdout new file mode 100644 index 0000000..ccc35c1 --- /dev/null +++ b/tests/process009.stdout @@ -0,0 +1,3 @@ +ExitFailure 129 +Just (ExitFailure 129) +Just (ExitFailure 129) _______________________________________________ Cvs-libraries mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-libraries
