]> gitweb.michael.orlitzky.com - hath.git/blobdiff - test/ShellTestsNet.hs
Bump cabal version, add homepage, and use sh-compatible examples.
[hath.git] / test / ShellTestsNet.hs
index b3306d00f5742d84f2952993b2438775ed4e6dcf..74acd737b0730021278335c8955e311ba82acb7d 100644 (file)
@@ -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-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