package cmd
import "github.com/dotcloud/docker/pkg/integration/cmd"
Index ¶
- Constants
- Variables
- type Cmd
- type Expected
- type Result
- func RunCmd(cmd Cmd) *Result
- func RunCommand(command string, args ...string) *Result
- func StartCmd(cmd Cmd) *Result
- func WaitOnCmd(timeout time.Duration, result *Result) *Result
- func (r *Result) Assert(t testingT, exp Expected)
- func (r *Result) Combined() string
- func (r *Result) Compare(exp Expected) error
- func (r *Result) SetExitError(err error)
- func (r *Result) Stderr() string
- func (r *Result) Stdout() string
- func (r *Result) String() string
Constants ¶
const ( // None is a token to inform Result.Assert that the output should be empty None string = "<NOTHING>" )
Variables ¶
var Matches = &matches{}
Matches is a gocheck.Checker for comparing a Result against an Expected
var Success = Expected{}
Success is the default expected result
Types ¶
type Cmd ¶
type Cmd struct { Command []string Timeout time.Duration Stdin io.Reader Stdout io.Writer Dir string Env []string }
Cmd contains the arguments and options for a process to run as part of a test suite.
type Expected ¶
Expected is the expected output from a Command. This struct is compared to a Result struct by Result.Assert().
type Result ¶
type Result struct { Cmd *exec.Cmd ExitCode int Error error // Timeout is true if the command was killed because it ran for too long Timeout bool // contains filtered or unexported fields }
Result stores the result of running a command
func RunCmd ¶
RunCmd runs a command and returns a Result
func RunCommand ¶
RunCommand parses a command line and runs it, returning a result
func StartCmd ¶
StartCmd starts a command, but doesn't wait for it to finish
func WaitOnCmd ¶
WaitOnCmd waits for a command to complete. If timeout is non-nil then only wait until the timeout.
func (*Result) Assert ¶
Assert compares the Result against the Expected struct, and fails the test if any of the expcetations are not met.
func (*Result) Combined ¶
Combined returns the stdout and stderr combined into a single string
func (*Result) Compare ¶
Compare returns an formatted error with the command, stdout, stderr, exit code, and any failed expectations
func (*Result) SetExitError ¶
SetExitError sets Error and ExitCode based on Error
func (*Result) Stderr ¶
Stderr returns the stderr of the process as a string
func (*Result) Stdout ¶
Stdout returns the stdout of the process as a string
func (*Result) String ¶
Source Files ¶
- Version
- v1.13.0-rc7
- Published
- Jan 12, 2017
- Platform
- js/wasm
- Imports
- 11 packages
- Last checked
- 9 seconds ago –
Tools for package owners.