Logo ProcessKit API Reference

ProcessResult Module

Functions and values

Function or value Description

ProcessResult.Create stdout stderr outcome duration

Full Usage: ProcessResult.Create stdout stderr outcome duration

Parameters:
Returns: ProcessResult<'T>
Type parameters: 'T

Build a `ProcessResult` with full control over stderr, the `Outcome` (e.g. `Outcome.Signalled` / `Outcome.TimedOut`), and the duration. Success is judged against the default `{0}` ok-codes.

stdout : 'T
stderr : string
outcome : Outcome
duration : TimeSpan
Returns: ProcessResult<'T>

ProcessResult.Failure stdout stderr exitCode

Full Usage: ProcessResult.Failure stdout stderr exitCode

Parameters:
    stdout : 'T
    stderr : string
    exitCode : int

Returns: ProcessResult<'T>
Type parameters: 'T

Build a failed `ProcessResult` (a non-zero exit) for tests. `exitCode` must be non-zero — `0` is rejected because the result is judged against the default `{0}` ok-codes, so a zero exit would make `IsSuccess` `true` (use `Success` for that). Negative codes are allowed (Windows reports them).

stdout : 'T
stderr : string
exitCode : int
Returns: ProcessResult<'T>

ProcessResult.Success stdout

Full Usage: ProcessResult.Success stdout

Parameters:
    stdout : 'T

Returns: ProcessResult<'T>
Type parameters: 'T

Build a successful `ProcessResult` (exit 0, given stdout) for tests.

stdout : 'T
Returns: ProcessResult<'T>

ProcessResult.ensureSuccess result

Full Usage: ProcessResult.ensureSuccess result

Parameters:
Returns: Result<ProcessResult<'T>, ProcessError>
Type parameters: 'T

Demand a successful run (an **accepted** exit code — one in `Command.OkCodes`, `{0}` by default): returns the result unchanged on success, otherwise the corresponding `ProcessError` (`Exit` / `Signalled` / `Timeout`). Generic over the captured-stdout type.

result : ProcessResult<'T>
Returns: Result<ProcessResult<'T>, ProcessError>

Type something to start searching.