X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=test%2FShellTestsNet.hs;h=74acd737b0730021278335c8955e311ba82acb7d;hb=bea923306878ccc5deb9e593aa6592550dcadad5;hp=7e3a95efee4c42c9864f0f0639566478a5a48f90;hpb=a2afcdfec4ded920e133f28e069275caadc890c0;p=hath.git diff --git a/test/ShellTestsNet.hs b/test/ShellTestsNet.hs index 7e3a95e..74acd73 100644 --- a/test/ShellTestsNet.hs +++ b/test/ShellTestsNet.hs @@ -1,10 +1,24 @@ module 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-net/*.test" + -- Get a CreateProcess object corresponding to our shell command. + let createproc = shell "shelltest test/shell-net/*.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