From 6f88d3dd6e107c996b701b7f4fccaef171440722 Mon Sep 17 00:00:00 2001 From: Favonia Date: Wed, 11 May 2011 22:35:53 -0400 Subject: Test cases for the new process group API. --- tests/processGroup002.hs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/processGroup002.hs (limited to 'tests/processGroup002.hs') diff --git a/tests/processGroup002.hs b/tests/processGroup002.hs new file mode 100644 index 0000000..c93a416 --- /dev/null +++ b/tests/processGroup002.hs @@ -0,0 +1,21 @@ +import System.Posix.Process + +main = do + pid <- getProcessID + ppid <- getParentProcessID + ppgid <- getProcessGroupIDOf ppid + -- join the parent process + putStr "Testing joinProcessGroup: " + joinProcessGroup ppgid + pgid1 <- getProcessGroupID + print $ ppgid == pgid1 + -- be a leader + putStr "Testing createProcessGroupFor: " + createProcessGroupFor pid + pgid2 <- getProcessGroupID + print $ pid == fromIntegral pgid2 + -- and join the parent again + putStr "Testing setProcessGroupIDOf: " + setProcessGroupIDOf pid ppgid + pgid3 <- getProcessGroupID + print $ ppgid == pgid3 -- cgit v1.2.3