test: add a shelltestrunner test suite for the man page examples.
[haeredes.git] / test / ShellTests.hs
1 module Main (main)
2 where
3
4 import System.Process (
5 CreateProcess( env ),
6 createProcess,
7 shell,
8 waitForProcess )
9 import System.Exit ( exitWith )
10
11 main :: IO ()
12 main = do
13 -- Get a CreateProcess object corresponding to our shell command.
14 let createproc = shell "shelltest test/shell/*.test"
15
16 -- But clear its environment before running the command.
17 let empty_env_createproc = createproc { env = Just [] }
18
19 -- Ignore stdin/stdout/stderr...
20 (_,_,_,hproc) <- createProcess empty_env_createproc
21
22 -- Now run the ProcessHandle and exit with its result.
23 result <- waitForProcess hproc
24 exitWith result