run

package
v0.8.2-beta.4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Entry contains all the state of one command run.

func (*Entry) Contains

func (e *Entry) Contains(s string) bool

Contains return true if either stdout or stderr contains the string s.

func (*Entry) ExitCode

func (e *Entry) ExitCode() int

ExitCode returns the exit status of the command.

func (*Entry) Lines

func (e *Entry) Lines() chan<- string

Lines iterates over all lines of the command output.

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor holds the context for forking a number of commands.

func (*Executor) History

func (e *Executor) History(n int) *Entry

History return the nth entry. The most recent command is at index 0.

func (*Executor) Last

func (e *Executor) Last() *Entry

Last returns the most recent Entry.

func (*Executor) RunCmd

func (e *Executor) RunCmd(cmd *exec.Cmd) (*Entry, error)

RunCmd executes a exec.Cmd

func (Executor) RunV

func (e Executor) RunV(name string, args ...string) (*Entry, error)

RunV executes a command with an optional array of arguments. RunV will wait until the spawned commands terminates before returning.

type Options

type Options struct {
	// Verbose controls if Executor should print command output to stdout and stderr.
	Verbose bool
}

Options holds configuration options for the Executor object.

type Run

type Run struct {
	// contains filtered or unexported fields
}

Run is the top level API objects. It can be used to create executor, responsible for running a series of commands.

func New

func New(options Options) *Run

New creates a new run context that can be used to run successive commands.

func (*Run) NewExecutor

func (r *Run) NewExecutor() *Executor

NewExecutor creates an executor for a specific test.

Jump to

Keyboard shortcuts

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