X-Git-Url: http://gitweb.michael.orlitzky.com/?p=haeredes.git;a=blobdiff_plain;f=test%2FShellTests.hs;fp=test%2FShellTests.hs;h=8874fcfeac6555fb820a91945946a2b76eb50c6a;hp=0000000000000000000000000000000000000000;hb=020ce4ca32627a92a6ed47922543912a57195377;hpb=7b1f25b5a8f60c2f388eff66a4532f424820e1d6 diff --git a/test/ShellTests.hs b/test/ShellTests.hs new file mode 100644 index 0000000..8874fcf --- /dev/null +++ b/test/ShellTests.hs @@ -0,0 +1,24 @@ +module Main (main) +where + +import System.Process ( + CreateProcess( env ), + createProcess, + shell, + waitForProcess ) +import System.Exit ( exitWith ) + +main :: IO () +main = do + -- 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