X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=test%2FShellTests.hs;h=8874fcfeac6555fb820a91945946a2b76eb50c6a;hb=e5fbb86fba692fea530e102a6991d1ee4913e75f;hp=1e884d5ef435eb5d7631e76046515a6d19d59724;hpb=a2afcdfec4ded920e133f28e069275caadc890c0;p=hath.git diff --git a/test/ShellTests.hs b/test/ShellTests.hs index 1e884d5..8874fcf 100644 --- a/test/ShellTests.hs +++ b/test/ShellTests.hs @@ -1,10 +1,24 @@ -module Main +module Main (main) where -import System.Process ( system ) +import System.Process ( + CreateProcess( env ), + createProcess, + shell, + waitForProcess ) import System.Exit ( exitWith ) main :: IO () main = do - result <- system "shelltest test/shell/*.test" + -- Get a CreateProcess object corresponding to our shell command. + let createproc = shell "shelltest test/shell/*.test" + + -- But clear its environment before running the command. + let empty_env_createproc = createproc { env = Just [] } + + -- Ignore stdin/stdout/stderr... + (_,_,_,hproc) <- createProcess empty_env_createproc + + -- Now run the ProcessHandle and exit with its result. + result <- waitForProcess hproc exitWith result