Documentation ¶
Index ¶
- Variables
- func NeedsExternalNetwork(t *testing.T)
- func NeedsGit(t *testing.T)
- type TestgoData
- func (tg *TestgoData) Cd(dir string)
- func (tg *TestgoData) Cleanup()
- func (tg *TestgoData) DoRun(args []string) error
- func (tg *TestgoData) GetCommit(repo string) string
- func (tg *TestgoData) Must(err error)
- func (tg *TestgoData) MustExist(path string)
- func (tg *TestgoData) MustNotExist(path string)
- func (tg *TestgoData) Path(name string) string
- func (tg *TestgoData) ReadLock() string
- func (tg *TestgoData) ReadManifest() string
- func (tg *TestgoData) Run(args ...string)
- func (tg *TestgoData) RunGit(dir string, args ...string)
- func (tg *TestgoData) RunGo(args ...string)
- func (tg *TestgoData) Setenv(name, val string)
- func (tg *TestgoData) TempDir(path string)
- func (tg *TestgoData) TempFile(path, contents string)
Constants ¶
This section is empty.
Variables ¶
var (
ExeSuffix string // ".exe" on Windows
)
Functions ¶
func NeedsExternalNetwork ¶
NeedsExternalNetwork makes sure the tests needing external network will not be run when executing tests in short mode.
Types ¶
type TestgoData ¶
type TestgoData struct {
// contains filtered or unexported fields
}
Manage a single run of the testgo binary.
func (*TestgoData) Cd ¶
func (tg *TestgoData) 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 (*TestgoData) Cleanup ¶
func (tg *TestgoData) Cleanup()
Cleanup cleans up a test that runs testgo.
func (*TestgoData) DoRun ¶
func (tg *TestgoData) DoRun(args []string) error
DoRun runs the test go command, recording stdout and stderr and returning exit status.
func (*TestgoData) GetCommit ¶
func (tg *TestgoData) GetCommit(repo string) string
func (*TestgoData) Must ¶
func (tg *TestgoData) Must(err error)
Must gives a fatal error if err is not nil.
func (*TestgoData) MustExist ¶
func (tg *TestgoData) MustExist(path string)
MustExist fails if path does not exist.
func (*TestgoData) MustNotExist ¶
func (tg *TestgoData) MustNotExist(path string)
MustNotExist fails if path exists.
func (*TestgoData) Path ¶
func (tg *TestgoData) Path(name string) string
Path returns the absolute pathname to file with the temporary directory.
func (*TestgoData) ReadLock ¶
func (tg *TestgoData) ReadLock() string
ReadLock returns the lock in the current directory.
func (*TestgoData) ReadManifest ¶
func (tg *TestgoData) ReadManifest() string
ReadManifest returns the manifest in the current directory.
func (*TestgoData) Run ¶
func (tg *TestgoData) Run(args ...string)
run runs the test go command, and expects it to succeed.
func (*TestgoData) RunGit ¶
func (tg *TestgoData) RunGit(dir string, args ...string)
RunGit runs a git command, and expects it to succeed.
func (*TestgoData) RunGo ¶
func (tg *TestgoData) RunGo(args ...string)
RunGo runs a go command, and expects it to succeed.
func (*TestgoData) Setenv ¶
func (tg *TestgoData) Setenv(name, val string)
Setenv sets an environment variable to use when running the test go command.
func (*TestgoData) TempDir ¶
func (tg *TestgoData) TempDir(path string)
TempDir adds a temporary directory for a run of testgo.
func (*TestgoData) TempFile ¶
func (tg *TestgoData) TempFile(path, contents string)
TempFile adds a temporary file for a run of testgo.