Create a process returning handles to stdin, stdout, and stderr as well as the process handle.
Modulehedgehog-extras-0.10.1.0Haskell2010
Hedgehog.Extras.Test.Process
- 1 type
- 16 values
- Packagehedgehog-extras-0.10.1.0
- Exports17
- LanguageHaskell2010
- LicenceApache-2.0
- SourceProcess.hs
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.
execAny :: (MonadTest m, MonadIO m, HasCallStack)=> ExecConfig-> StringThe binary to launch
-> [String]The binary's arguments
-> m (ExitCode, String, String)exit code, stdout, stderr
Execute a process, returning the error code, the stdout, and the stderr.
Execute a process, returning ().
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.
execFlexAny' :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack)=> ExecConfig-> StringpkgBin: name of the binary to launch via 'cabal exec'-> StringenvBin: environment variable defining the binary to launch the process, when in Nix-> [String]-> m (ExitCode, String, String)exit code, stdout, stderr
Run a process, returning its exit code, its stdout, and its stderr.
Contrary to execFlex', this function doesn't fail if the call fails.
So, if you want to test something negative, this is the function to use.
procFlex :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack)=> StringCabal package name corresponding to the executable
-> StringEnvironment variable pointing to the binary to run
-> [String]Arguments to the CLI command
-> m CreateProcessCaptured 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.
binFlex Compute the path to the binary given a package name or an environment variable override.
Compute the project base. This will be based on either the CARDANO_NODE_SRC
environment variable or the first parent directory that contains the cabal.project.
Both should point to the root directory of the Github project checkout.
Wait for process to exit.
Wait for process to exit or return Nothing if interrupted by an asynchronous exception.
Get the process ID.
Get the process ID.
Wait a maximum of seconds secons for process to exit.
Configuration for starting a new process. This is a subset of CreateProcess.
Constructors
ExecConfigexecConfigEnv :: Last [(String, String)]execConfigCwd :: Last FilePath
Instances4Eq, Show, Generic, Rep
Eq ExecConfigDefined in hedgehog-extras-0.10.1.0 · Hedgehog.Extras.Test.ProcessShow ExecConfigDefined in hedgehog-extras-0.10.1.0 · Hedgehog.Extras.Test.ProcessGeneric ExecConfigDefined in hedgehog-extras-0.10.1.0 · Hedgehog.Extras.Test.Processtype Rep ExecConfig = D1 ('MetaDataDefined in hedgehog-extras-0.10.1.0 · Hedgehog.Extras.Test.Process"ExecConfig"
"Hedgehog.Extras.Test.Process"
"hedgehog-extras-0.10.1.0-LXIFvKBRj3yFoVjPeWrEyD"
'False) (C1 ('MetaCons"ExecConfig"
'PrefixI 'True) (S1 ('MetaSel ('Just"execConfigEnv"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last [(String, String)])) :*: S1 ('MetaSel ('Just"execConfigCwd"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Last FilePath))))