[commit: packages/process] master, new-flags, new-flags-no-f3df9d6: Include some sanity checks for new flags (431379b)
git at git.haskell.org
git at git.haskell.org
Mon Nov 2 06:23:47 UTC 2015
Repository : ssh://git@git.haskell.org/process
On branches: master,new-flags,new-flags-no-f3df9d6
Link : http://ghc.haskell.org/trac/ghc/changeset/431379b80234618c2642667928aa21f543d9c4e6/process
>---------------------------------------------------------------
commit 431379b80234618c2642667928aa21f543d9c4e6
Author: Michael Snoyman <michael at snoyman.com>
Date: Wed Aug 19 11:02:21 2015 +0300
Include some sanity checks for new flags
>---------------------------------------------------------------
431379b80234618c2642667928aa21f543d9c4e6
test/main.hs | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/test/main.hs b/test/main.hs
index 2d415ce..40558b2 100644
--- a/test/main.hs
+++ b/test/main.hs
@@ -1,4 +1,5 @@
import Control.Exception
+import System.Exit
import System.IO.Error
import System.Process
@@ -12,3 +13,18 @@ main = do
case res of
Left True -> return ()
_ -> error $ show res
+
+ let test name modifier = do
+ putStrLn $ "Running test: " ++ name
+ (_, _, _, ph) <- createProcess
+ $ modifier $ proc "echo" ["hello", "world"]
+ ec <- waitForProcess ph
+ if ec == ExitSuccess
+ then putStrLn $ "Success running: " ++ name
+ else error $ "echo returned: " ++ show ec
+
+ test "detach_console" $ \cp -> cp { detach_console = True }
+ test "create_new_console" $ \cp -> cp { create_new_console = True }
+ test "new_session" $ \cp -> cp { new_session = True }
+
+ putStrLn "Tests passed successfully"
More information about the ghc-commits
mailing list