Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data ExecConfig = ExecConfig {
- execConfigEnv :: Last [(String, String)]
- execConfigCwd :: Last FilePath
- defaultExecConfig :: ExecConfig
- execDetailFlex :: HasCallStack => Member (Embed IO) r => Member (Error GenericError) r => Member (Error IOException) r => Member Hedgehog r => Member Log r => ExecConfig -> String -> String -> [String] -> Sem r (ExitCode, String, String)
- execFlex :: HasCallStack => Member (Embed IO) r => Member Hedgehog r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => ExecConfig -> String -> String -> [String] -> Sem r (ExitCode, String, String)
- execFlexOk :: HasCallStack => Member (Embed IO) r => Member Hedgehog r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => String -> String -> [String] -> Sem r String
- execFlexOk' :: HasCallStack => Member (Embed IO) r => Member Hedgehog r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => ExecConfig -> String -> String -> [String] -> Sem r String
- execOk :: HasCallStack => Member (Embed IO) r => Member Hedgehog r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => ExecConfig -> String -> [String] -> Sem r String
- execOk_ :: HasCallStack => Member (Embed IO) r => Member Hedgehog r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => ExecConfig -> String -> [String] -> Sem r ()
- exec :: HasCallStack => Member (Embed IO) r => Member Hedgehog r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => ExecConfig -> String -> [String] -> Sem r (ExitCode, String, String)
- procFlex :: HasCallStack => Member (Embed IO) r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => String -> String -> [String] -> Sem r CreateProcess
- procFlex' :: HasCallStack => Member (Embed IO) r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => ExecConfig -> String -> String -> [String] -> Sem r CreateProcess
- binFlex :: HasCallStack => Member (Embed IO) r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => String -> String -> Sem r FilePath
- waitSecondsForProcess :: forall (r :: EffectRow). (Member (Embed IO) r, Member (Error GenericError :: (Type -> Type) -> Type -> Type) r, Member (Error IOException :: (Type -> Type) -> Type -> Type) r, Member (Error TimedOut :: (Type -> Type) -> Type -> Type) r, Member Log r) => Int -> ProcessHandle -> Sem r (Maybe ExitCode)
- waitSecondsForProcessOk :: HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => Int -> ProcessHandle -> Sem r ExitCode
Documentation
data ExecConfig Source #
Configuration for starting a new process. This is a subset of CreateProcess
.
ExecConfig | |
|
Instances
execDetailFlex :: HasCallStack => Member (Embed IO) r => Member (Error GenericError) r => Member (Error IOException) r => Member Hedgehog r => Member Log r => ExecConfig -> String -> String -> [String] -> Sem r (ExitCode, String, String) Source #
:: HasCallStack | |
=> Member (Embed IO) r | |
=> Member Hedgehog r | |
=> Member (Error GenericError) r | |
=> Member (Error IOException) r | |
=> Member Log r | |
=> ExecConfig | |
-> String |
|
-> String |
|
-> [String] | |
-> Sem r (ExitCode, String, String) | exit code, stdout, stderr |
Run a process, returning its exit code, its stdout, and its stderr.
Contrary to execFlexOk'
, this function doesn't fail if the call fails.
So, if you want to test something negative, this is the function to use.
execFlexOk :: HasCallStack => Member (Embed IO) r => Member Hedgehog r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => String -> String -> [String] -> Sem r String Source #
Create a process returning its stdout.
Being a flex
function means that the environment determines how the process is launched.
When running in a nix environment, the envBin
argument describes the environment variable
that defines the binary to use to launch the process.
When running outside a nix environment, the pkgBin
describes the name of the binary
to launch via cabal exec.
execFlexOk' :: HasCallStack => Member (Embed IO) r => Member Hedgehog r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => ExecConfig -> String -> String -> [String] -> Sem r String Source #
execOk :: HasCallStack => Member (Embed IO) r => Member Hedgehog r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => ExecConfig -> String -> [String] -> Sem r String Source #
Execute a process, returning the stdout. Fail if the call returns
with a non-zero exit code. For a version that doesn't fail upon receiving
a non-zero exit code, see execAny
.
execOk_ :: HasCallStack => Member (Embed IO) r => Member Hedgehog r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => ExecConfig -> String -> [String] -> Sem r () Source #
Execute a process, returning ()
.
:: HasCallStack | |
=> Member (Embed IO) r | |
=> Member Hedgehog r | |
=> Member (Error GenericError) r | |
=> Member (Error IOException) r | |
=> Member Log r | |
=> ExecConfig | |
-> String | The binary to launch |
-> [String] | The binary's arguments |
-> Sem r (ExitCode, String, String) | exit code, stdout, stderr |
Execute a process, returning the error code, the stdout, and the stderr.
:: HasCallStack | |
=> Member (Embed IO) r | |
=> Member (Error GenericError) r | |
=> Member (Error IOException) r | |
=> Member Log r | |
=> String | Cabal package name corresponding to the executable |
-> String | Environment variable pointing to the binary to run |
-> [String] | Arguments to the CLI command |
-> Sem r CreateProcess | Captured stdout |
Create a CreateProcess
describing how to start a process given the Cabal package name
corresponding to the executable, an environment variable pointing to the executable,
and an argument list.
The actual executable used will the one specified by the environment variable, but if the environment variable is not defined, it will be found instead by consulting the "plan.json" generated by cabal. It is assumed that the project has already been configured and the executable has been built.
:: HasCallStack | |
=> Member (Embed IO) r | |
=> Member (Error GenericError) r | |
=> Member (Error IOException) r | |
=> Member Log r | |
=> ExecConfig | |
-> String | Cabal package name corresponding to the executable |
-> String | Environment variable pointing to the binary to run |
-> [String] | Arguments to the CLI command |
-> Sem r CreateProcess | Captured stdout |
:: HasCallStack | |
=> Member (Embed IO) r | |
=> Member (Error GenericError) r | |
=> Member (Error IOException) r | |
=> Member Log r | |
=> String | Package name |
-> String | Environment variable pointing to the binary to run |
-> Sem r FilePath | Path to executable |
Compute the path to the binary given a package name or an environment variable override.
waitSecondsForProcess :: forall (r :: EffectRow). (Member (Embed IO) r, Member (Error GenericError :: (Type -> Type) -> Type -> Type) r, Member (Error IOException :: (Type -> Type) -> Type -> Type) r, Member (Error TimedOut :: (Type -> Type) -> Type -> Type) r, Member Log r) => Int -> ProcessHandle -> Sem r (Maybe ExitCode) #
waitSecondsForProcessOk :: HasCallStack => Member Hedgehog r => Member (Embed IO) r => Member (Error GenericError) r => Member (Error IOException) r => Member Log r => Int -> ProcessHandle -> Sem r ExitCode Source #
Wait a maximum of seconds
secons for process to exit.