Safe Haskell | None |
---|
- type SandboxStateRef = IORef SandboxState
- newtype Sandbox a = Sandbox {
- runSandbox :: ErrorT String (ReaderT SandboxStateRef IO) a
- data SandboxState = SandboxState {
- ssName :: String
- ssDataDir :: FilePath
- ssProcesses :: Map String SandboxedProcess
- ssProcessOrder :: [String]
- ssAllocatedPorts :: Map String PortNumber
- ssAvailablePorts :: [PortNumber]
- ssFiles :: Map String FilePath
- ssVariables :: Map String ByteString
- data SandboxedProcess = SandboxedProcess {
- spName :: String
- spBinary :: FilePath
- spArgs :: [String]
- spWait :: Maybe Int
- spCapture :: Maybe Capture
- spInstance :: Maybe SandboxedProcessInstance
- data Capture
- data SandboxedProcessInstance
- = RunningInstance ProcessHandle Handle (Maybe Handle)
- | StoppedInstance ExitCode (Maybe String)
- 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 -> 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
- sendToPort :: String -> String -> Int -> Sandbox String
- getNewPort :: String -> Sandbox PortNumber
- isBindable :: PortNumber -> IO Bool
- startProcess :: SandboxedProcess -> Sandbox SandboxedProcess
- formatCommandLine :: String -> [String] -> String
- stopProcess :: SandboxedProcess -> Sandbox SandboxedProcess
- 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
- displayBanner :: Sandbox ()
- installSignalHandlers :: Sandbox ()
- data SandboxSeed
- = SandboxFixedSeed Int
- | SandboxRandomSeed
- data SandboxTestOptions = SandboxTestOptions {
- stoSeed :: Maybe SandboxSeed
- stoMaximumGeneratedTests :: Maybe Int
- stoMaximumUnsuitableGeneratedTests :: Maybe Int
- stoMaximumTestSize :: Maybe Int
- putOptions :: SandboxTestOptions -> Sandbox ()
- getOptions :: Sandbox (Maybe SandboxTestOptions)
- optionsVariable :: String
Documentation
Sandbox | |
|
Monad Sandbox | |
Functor Sandbox | |
Applicative Sandbox | |
MonadIO Sandbox | |
MonadBase IO Sandbox | |
MonadBaseControl IO Sandbox | |
MonadError String Sandbox | |
MonadReader (IORef SandboxState) Sandbox |
data SandboxState Source
SandboxState | |
|
data SandboxedProcess Source
SandboxedProcess | |
|
data SandboxedProcessInstance Source
RunningInstance ProcessHandle Handle (Maybe Handle) | |
StoppedInstance ExitCode (Maybe String) |
pretty :: SandboxState -> StringSource
header :: SandboxState -> StringSource
newSandboxState :: String -> FilePath -> IO SandboxStateRefSource
registerProcess :: String -> FilePath -> [String] -> Maybe Int -> Maybe Capture -> Sandbox SandboxedProcessSource
isValidProcessName :: String -> BoolSource
getProcess :: String -> Sandbox SandboxedProcessSource
secondInµs :: IntSource
setFile' :: String -> String -> SandboxState -> IO (FilePath, SandboxState)Source
bufferSize :: IntSource
hReadWithTimeout :: Handle -> Int -> Sandbox ByteStringSource
sendToPort :: String -> String -> Int -> Sandbox StringSource
getNewPort :: String -> Sandbox PortNumberSource
isBindable :: PortNumber -> IO BoolSource
formatCommandLine :: String -> [String] -> StringSource
hSignalProcess :: Signal -> ProcessHandle -> IO ()Source
killProcess :: ProcessHandle -> IO ()Source
hGetProcessID :: ProcessHandle -> IO ProcessIDSource
interactWithProcess :: SandboxedProcess -> String -> Int -> Sandbox StringSource
getProcessInputHandle :: SandboxedProcess -> Sandbox HandleSource
getProcessCapturedOutputHandle :: SandboxedProcess -> Sandbox HandleSource
getProcessBinary :: SandboxedProcess -> Sandbox FilePathSource
findExecutables :: [FilePath] -> IO [FilePath]Source
getProcessCandidateBinaries :: SandboxedProcess -> [FilePath]Source
Sets a custom variable in the sandbox monad.
:: String | Variable key |
-> Sandbox Bool |
Checks that a custom sandbox variable is set.
Returns the value of a previously set sandbox variable (or a provided default value if unset)
verbosityKey :: StringSource
displayBanner :: Sandbox ()Source
data SandboxSeed Source
Generic SandboxSeed | |
Serialize SandboxSeed |
data SandboxTestOptions Source
SandboxTestOptions | |
|
putOptions :: SandboxTestOptions -> Sandbox ()Source
getOptions :: Sandbox (Maybe SandboxTestOptions)Source
optionsVariable :: StringSource