test

package
v0.0.0-...-d7cdca3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2017 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExeSuffix string // ".exe" on Windows

)

Functions

func NeedsExternalNetwork

func NeedsExternalNetwork(t *testing.T)

NeedsExternalNetwork makes sure the tests needing external network will not be run when executing tests in short mode.

func NeedsGit

func NeedsGit(t *testing.T)

NeedsGit will make sure the tests that require git will be skipped if the git binary is not available.

Types

type Helper

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

Helper with utilities for testing.

func NewHelper

func NewHelper(t *testing.T) *Helper

NewHelper initializes a new helper for testing.

func (*Helper) Cd

func (h *Helper) Cd(dir string)

Cd changes the current directory to the named directory. Note that using this means that the test must not be run in parallel with any other tests.

func (*Helper) Cleanup

func (h *Helper) Cleanup()

Cleanup cleans up a test that runs testgo.

func (*Helper) DoRun

func (h *Helper) DoRun(args []string) error

DoRun runs the test go command, recording stdout and stderr and returning exit status.

func (*Helper) GetCommit

func (h *Helper) GetCommit(repo string) string

func (*Helper) Must

func (h *Helper) Must(err error)

Must gives a fatal error if err is not nil.

func (*Helper) MustExist

func (h *Helper) MustExist(path string)

MustExist fails if path does not exist.

func (*Helper) MustNotExist

func (h *Helper) MustNotExist(path string)

MustNotExist fails if path exists.

func (*Helper) Path

func (h *Helper) Path(name string) string

Path returns the absolute pathname to file with the temporary directory.

func (*Helper) ReadLock

func (h *Helper) ReadLock() string

ReadLock returns the lock in the current directory.

func (*Helper) ReadManifest

func (h *Helper) ReadManifest() string

ReadManifest returns the manifest in the current directory.

func (*Helper) Run

func (h *Helper) Run(args ...string)

run runs the test go command, and expects it to succeed.

func (*Helper) RunGit

func (h *Helper) RunGit(dir string, args ...string)

RunGit runs a git command, and expects it to succeed.

func (*Helper) RunGo

func (h *Helper) RunGo(args ...string)

RunGo runs a go command, and expects it to succeed.

func (*Helper) Setenv

func (h *Helper) Setenv(name, val string)

Setenv sets an environment variable to use when running the test go command.

func (*Helper) TempDir

func (h *Helper) TempDir(path string)

TempDir adds a temporary directory for a run of testgo.

func (*Helper) TempFile

func (h *Helper) TempFile(path, contents string)

TempFile adds a temporary file for a run of testgo.

Jump to

Keyboard shortcuts

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