summaryrefslogtreecommitdiff
path: root/testsuite/timeout
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2015-07-21 17:37:03 +0200
committerBen Gamari <ben@smart-cactus.org>2015-07-21 21:42:54 +0200
commitf519cb551c5b17feb7dbc12d5c08ee64a64c6a92 (patch)
tree417b2e9e7ebb44a13a73ec088c9dec0c29b4ab8d /testsuite/timeout
parent35eb736b3a171ce70bf4ddfe4717b0968cb1d1c6 (diff)
downloadhaskell-f519cb551c5b17feb7dbc12d5c08ee64a64c6a92.tar.gz
testsuite: Show killed command line on timeout
Diffstat (limited to 'testsuite/timeout')
-rw-r--r--testsuite/timeout/timeout.hs8
-rw-r--r--testsuite/timeout/timeout.py3
2 files changed, 6 insertions, 5 deletions
diff --git a/testsuite/timeout/timeout.hs b/testsuite/timeout/timeout.hs
index f78baa10ea..3532497eef 100644
--- a/testsuite/timeout/timeout.hs
+++ b/testsuite/timeout/timeout.hs
@@ -33,8 +33,8 @@ main = do
_ -> die ("Can't parse " ++ show secs ++ " as a number of seconds")
_ -> die ("Bad arguments " ++ show args)
-timeoutMsg :: String
-timeoutMsg = "Timeout happened...killing process..."
+timeoutMsg :: String -> String
+timeoutMsg cmd = "Timeout happened...killing process "++cmd++"..."
run :: Int -> String -> IO ()
#if !defined(mingw32_HOST_OS)
@@ -61,7 +61,7 @@ run secs cmd = do
r <- takeMVar m
case r of
Nothing -> do
- hPutStrLn stderr timeoutMsg
+ hPutStrLn stderr (timeoutMsg cmd)
killProcess pid
exitWith (ExitFailure 99)
Just (Exited r) -> exitWith r
@@ -122,7 +122,7 @@ run secs cmd =
let millisecs = secs * 1000
rc <- waitForSingleObject handle (fromIntegral millisecs)
if rc == cWAIT_TIMEOUT
- then do hPutStrLn stderr timeoutMsg
+ then do hPutStrLn stderr (timeoutMsg cmd)
terminateJobObject job 99
exitWith (ExitFailure 99)
else alloca $ \p_exitCode ->
diff --git a/testsuite/timeout/timeout.py b/testsuite/timeout/timeout.py
index df50806b9b..1016e2db33 100644
--- a/testsuite/timeout/timeout.py
+++ b/testsuite/timeout/timeout.py
@@ -35,7 +35,8 @@ try:
else:
# parent
def handler(signum, frame):
- sys.stderr.write('Timeout happened...killing process...\n')
+ msg = 'Timeout happened...killing process %s...\n' % cmd
+ sys.stderr.write(msg)
killProcess(pid)
sys.exit(99)
old = signal.signal(signal.SIGALRM, handler)