Commit 06bb9851 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Add a test for better exceptions when ewxecuting programs

parent df810a59
......@@ -32,3 +32,4 @@ test('T3994', only_ways(['threaded1','threaded2']), compile_and_run, [''])
test('T4889', normal, compile_and_run, [''])
test('process009', when(opsys('mingw32'), skip), compile_and_run, [''])
test('process010', normal, compile_and_run, [''])
import System.IO.Error
import System.Process
main :: IO ()
main = do run "/bin/true"
run "/bin/false"
run "/non/existent"
putStrLn "Done"
run :: FilePath -> IO ()
run fp = (rawSystem fp [] >>= print)
`catchIOError` \e -> putStrLn ("Exc: " ++ show e)
ExitSuccess
ExitFailure 1
Exc: /non/existent: rawSystem: runInteractiveProcess: exec: does not exist (No such file or directory)
Done
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