testprocess

package
v1.10.0-alpha.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package testprocess owns subprocess lifetimes in integration test harnesses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	*exec.Cmd
	// contains filtered or unexported fields
}

Cmd runs a command with cleanup of its process group on supported Unix hosts. Configure the embedded Cmd before Start; do not call its execution methods directly or override Cancel or SysProcAttr. Start and Wait must each be called at most once. Every successful Start must be followed by Wait.

func CommandContext

func CommandContext(ctx context.Context, name string, args ...string) *Cmd

CommandContext constructs a command whose descendants share its lifetime. On Unix, loss of the parent process also kills the process group. Descendants must not detach into another group. Other platforms retain exec semantics.

func (*Cmd) CombinedOutput

func (c *Cmd) CombinedOutput() ([]byte, error)

CombinedOutput runs the command and returns its combined standard streams.

func (*Cmd) Run

func (c *Cmd) Run() error

Run starts the command and waits for its completion.

func (*Cmd) Start

func (c *Cmd) Start() error

Start establishes the process guardian before starting the command.

func (*Cmd) Wait

func (c *Cmd) Wait() error

Wait waits for the command and releases its guardian and descendants.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL