Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Port = Int
- type SandboxStateRef = IORef SandboxState
- type Sandbox = ExceptT String (ReaderT SandboxStateRef IO)
- data PortID = PortNumber PortNumber
- runSandbox :: Sandbox a -> SandboxStateRef -> IO (Either String a)
- errorHandler :: String -> IO a
- runSandbox' :: SandboxStateRef -> Sandbox a -> IO a
- data SandboxState = SandboxState {}
- data SandboxedProcess = SandboxedProcess {}
- data Capture
- data SandboxedProcessInstance
- get :: Sandbox SandboxState
- put :: SandboxState -> Sandbox SandboxState
- pretty :: SandboxState -> String
- header :: SandboxState -> String
- footer :: String
- newSandboxState :: String -> FilePath -> IO SandboxStateRef
- registerProcess :: String -> FilePath -> [String] -> Maybe Int -> Maybe Capture -> Maybe [(String, String)] -> Maybe FilePath -> Sandbox SandboxedProcess
- isValidProcessName :: String -> Bool
- getProcess :: String -> Sandbox SandboxedProcess
- updateProcess :: SandboxedProcess -> Sandbox SandboxedProcess
- secondInµs :: Int
- setFile' :: String -> String -> SandboxState -> IO (FilePath, SandboxState)
- bufferSize :: Int
- hReadWithTimeout :: Handle -> Int -> Sandbox ByteString
- connectTo :: HostName -> PortID -> IO Handle
- inet_addr :: HostName -> IO HostAddress
- sendToPort :: String -> String -> Int -> Sandbox String
- getNewPort :: String -> Sandbox Port
- isBindable' :: Port -> IO Bool
- isBindable :: Port -> IO Bool
- startProcess :: SandboxedProcess -> Sandbox SandboxedProcess
- formatCommandLine :: String -> [String] -> String
- stopProcess :: SandboxedProcess -> Sandbox SandboxedProcess
- getAvailablePids :: Sandbox [ProcessID]
- cleanUpProcesses :: Sandbox ()
- hSignalProcess :: Signal -> ProcessHandle -> IO ()
- killProcess :: ProcessHandle -> IO ()
- hGetProcessID :: ProcessHandle -> IO ProcessID
- interactWithProcess :: SandboxedProcess -> String -> Int -> Sandbox String
- getProcessInputHandle :: SandboxedProcess -> Sandbox Handle
- getProcessCapturedOutputHandle :: SandboxedProcess -> Sandbox Handle
- getProcessBinary :: SandboxedProcess -> Sandbox FilePath
- findExecutables :: [FilePath] -> IO [FilePath]
- tryBinary :: FilePath -> IO (Maybe FilePath)
- getProcessCandidateBinaries :: SandboxedProcess -> [FilePath]
- expand :: String -> IO String
- whenM :: Monad m => m Bool -> m () -> m ()
- setVariable :: Serialize a => String -> a -> Sandbox a
- checkVariable :: String -> Sandbox Bool
- getVariable :: Serialize a => String -> a -> Sandbox a
- unsetVariable :: String -> Sandbox ()
- isVerbose :: Sandbox Bool
- verbosityKey :: String
- isCleanUp :: Sandbox Bool
- cleanUpKey :: String
- displayBanner :: Sandbox ()
- installSignalHandlers :: Sandbox ()
- data SandboxSeed
- data SandboxTestOptions = SandboxTestOptions {}
- putOptions :: SandboxTestOptions -> Sandbox ()
- getOptions :: Sandbox (Maybe SandboxTestOptions)
- optionsVariable :: String
Documentation
type SandboxStateRef = IORef SandboxState Source #
runSandbox :: Sandbox a -> SandboxStateRef -> IO (Either String a) Source #
errorHandler :: String -> IO a Source #
runSandbox' :: SandboxStateRef -> Sandbox a -> IO a Source #
data SandboxState Source #
SandboxState | |
|
put :: SandboxState -> Sandbox SandboxState Source #
pretty :: SandboxState -> String Source #
header :: SandboxState -> String Source #
newSandboxState :: String -> FilePath -> IO SandboxStateRef Source #
:: String | Process Name |
-> FilePath | Path to the application binary |
-> [String] | Arguments to pass on the command-line |
-> Maybe Int | Time to wait (in s.) before checking that the process is still up |
-> Maybe Capture | Which outputs to capture (if any) |
-> Maybe [(String, String)] | Evironment variables |
-> Maybe FilePath | Working directory for the new process |
-> Sandbox SandboxedProcess |
isValidProcessName :: String -> Bool Source #
secondInµs :: Int Source #
setFile' :: String -> String -> SandboxState -> IO (FilePath, SandboxState) Source #
bufferSize :: Int Source #
hReadWithTimeout :: Handle -> Int -> Sandbox ByteString Source #
cleanUpProcesses :: Sandbox () Source #
hSignalProcess :: Signal -> ProcessHandle -> IO () Source #
killProcess :: ProcessHandle -> IO () Source #
hGetProcessID :: ProcessHandle -> IO ProcessID Source #
interactWithProcess :: SandboxedProcess -> String -> Int -> Sandbox String Source #
Sets a custom variable in the sandbox monad.
Checks that a custom sandbox variable is set.
Returns the value of a previously set sandbox variable (or a provided default value if unset)
cleanUpKey :: String Source #
displayBanner :: Sandbox () Source #
installSignalHandlers :: Sandbox () Source #
data SandboxSeed Source #
Instances
Generic SandboxSeed Source # | |
Defined in Test.Sandbox.Internals type Rep SandboxSeed :: Type -> Type # from :: SandboxSeed -> Rep SandboxSeed x # to :: Rep SandboxSeed x -> SandboxSeed # | |
Serialize SandboxSeed Source # | |
Defined in Test.Sandbox.Internals put :: Putter SandboxSeed # get :: Get SandboxSeed # | |
type Rep SandboxSeed Source # | |
Defined in Test.Sandbox.Internals type Rep SandboxSeed = D1 ('MetaData "SandboxSeed" "Test.Sandbox.Internals" "test-sandbox-0.1.9-7VIKFLuztYLBj00GkIPGRv" 'False) (C1 ('MetaCons "SandboxFixedSeed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "SandboxRandomSeed" 'PrefixI 'False) (U1 :: Type -> Type)) |
data SandboxTestOptions Source #
Instances
putOptions :: SandboxTestOptions -> Sandbox () Source #