X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=test%2FShellTests.hs;h=6a55da0495d2fb7848e4da3730feca3c5e275f0e;hb=2744428b39c7f253d6629335b9cb4122e224e177;hp=65a10ccca97daf27dd80e55e15e8a75e3d55a735;hpb=72645e4a98e9d14eac3220c00058efe2d8fae489;p=hath.git diff --git a/test/ShellTests.hs b/test/ShellTests.hs index 65a10cc..6a55da0 100644 --- a/test/ShellTests.hs +++ b/test/ShellTests.hs @@ -1,10 +1,24 @@ module Main where -import System.Cmd ( 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