Commit 5ecf94de authored by novadenizen's avatar novadenizen
Browse files

Now allows UserInterrupt to pass through

parent 97f3395f
......@@ -29,7 +29,9 @@ import Distribution.TestSuite
import Distribution.Text
import Distribution.Verbosity
import Control.Exception ( bracket, catch, SomeException )
import Control.Exception ( bracket, catch, fromException, SomeException,
AsyncException(UserInterrupt) )
import Control.Exception.Base ( throwIO )
import System.Directory
( createDirectoryIfMissing, doesDirectoryExist, doesFileExist
, getCurrentDirectory, removeDirectoryRecursive, removeFile
......@@ -212,12 +214,14 @@ stubMain :: IO [Test] -> IO ()
stubMain tests = do
(f, n) <- fmap read getContents
dir <- getCurrentDirectory
results <- ((tests >>= stubRunTests) `catch` errHandler)
results <- (tests >>= stubRunTests) `catch` errHandler
setCurrentDirectory dir
stubWriteLog f n results
where
errHandler :: SomeException -> IO TestLogs
errHandler e = return $ TestLog { testName = "Cabal test suite exception",
errHandler e = case fromException e of
Just UserInterrupt -> throwIO e
_ -> return $ TestLog { testName = "Cabal test suite exception",
testOptionsReturned = [],
testResult = Error $ show e }
......
Markdown is supported
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