HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulehedgehog-extras-0.10.1.0Haskell2010

Hedgehog.Extras.Test.Process

  • 1 type
  • 16 values

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.

valueexecFlexAny'
  1. :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack)
  2. => ExecConfig
  3. -> String

    pkgBin: name of the binary to launch via 'cabal exec'

  4. -> String

    envBin: environment variable defining the binary to launch the process, when in Nix

  5. -> [String]
  6. -> 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.

valueprocFlex
  1. :: (MonadTest m, MonadCatch m, MonadIO m, HasCallStack)
  2. => String

    Cabal package name corresponding to the executable

  3. -> String

    Environment variable pointing to the binary to run

  4. -> [String]

    Arguments to the CLI command

  5. -> m 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.

valuegetProjectBase :: (MonadTest m, MonadIO m) => m String
#

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.

datadata ExecConfig
#

Configuration for starting a new process. This is a subset of CreateProcess.

Instances4Eq, Show, Generic, Rep