test-sandbox 0.0.1.12 → 0.0.1.13
raw patch · 3 files changed
+27/−1 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- src/Test/Sandbox/Internals.hs +7/−0
- test-sandbox.cabal +1/−1
- test/test.hs +19/−0
src/Test/Sandbox/Internals.hs view
@@ -339,6 +339,13 @@ , spPid = Just pid , spPGid = Just pgid }+ Just ExitSuccess -> do+ mStr <- case hOutRO of+ Just h -> liftM Just $ liftIO $ hGetContents h+ Nothing -> return Nothing+ updateProcess sp {+ spInstance = Just $ StoppedInstance ExitSuccess mStr+ } Just errno' -> throwError $ "Process " ++ spName sp ++ " not running.\n" ++ " - command-line: " ++ formatCommandLine bin args ++ "\n" ++ " - exit code: " ++ show errno'
test-sandbox.cabal view
@@ -1,5 +1,5 @@ Name: test-sandbox-Version: 0.0.1.12+Version: 0.0.1.13 Cabal-Version: >= 1.14 Category: Testing Synopsis: Sandbox for system tests
test/test.hs view
@@ -14,6 +14,7 @@ import qualified Data.Text as T import qualified Data.Map as M import System.Posix.Files+import System.Exit (ExitCode(..)) import Data.IORef import Data.Char import Control.Concurrent@@ -74,6 +75,24 @@ runSandbox' ref I.isVerbose `shouldReturn` False _ <- runSandbox' ref $ setVariable I.verbosityKey True runSandbox' ref I.isVerbose `shouldReturn` True+ it ": run" $ do+ withSandbox $ \ref -> runSandbox' ref $ do+ file <- setFile "echoecho"+ [str|#!/usr/bin/env bash+ |echo "echoecho"+ |]+ liftIO $ setExecuteMode file++ pname1 <- register "echo1" file [] def+ (exitCode1, mStr1) <- run pname1 1+ liftIO $ exitCode1 `shouldBe` ExitSuccess+ liftIO $ mStr1 `shouldBe` Nothing++ pname2 <- register "echo2" file [] def { psCapture = Just CaptureStdout }+ (exitCode2, mStr2) <- run pname2 1+ liftIO $ exitCode2 `shouldBe` ExitSuccess+ liftIO $ mStr2 `shouldBe` Just "echoecho\n"+ #if defined(__MACOSX__) || defined(__WIN32__) #else describe "signal test" $ do