testenv

package
v0.0.0-...-885ca4e Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Go1Point

func Go1Point() int

Go1Point returns the x in Go 1.x.

func GoTool

func GoTool() (string, error)

GoTool reports the path to the Go tool.

func GoToolPath

func GoToolPath(t testing.TB) string

GoToolPath reports the path to the Go tool. It is a convenience wrapper around GoTool. If the tool is unavailable GoToolPath calls t.Skip. If the tool should be available and isn't, GoToolPath calls t.Fatal.

func HasExternalNetwork

func HasExternalNetwork() bool

HasExternalNetwork reports whether the current system can use external (non-localhost) networks.

func HasGoBuild

func HasGoBuild() bool

HasGoBuild reports whether the current system can build programs with “go build” and then run them with os.StartProcess or exec.Command.

func MustHaveExternalNetwork

func MustHaveExternalNetwork(t testing.TB)

MustHaveExternalNetwork checks that the current system can use external (non-localhost) networks. If not, MustHaveExternalNetwork calls t.Skip with an explanation.

func MustHaveGoBuild

func MustHaveGoBuild(t testing.TB)

MustHaveGoBuild checks that the current system can build programs with “go build” and then run them with os.StartProcess or exec.Command. If not, MustHaveGoBuild calls t.Skip with an explanation.

func NeedsGo1Point

func NeedsGo1Point(t Testing, x int)

NeedsGo1Point skips t if the Go version used to run the test is older than 1.x.

Types

type Testing

type Testing interface {
	Skipf(format string, args ...interface{})
	Fatalf(format string, args ...interface{})
}

Testing is an abstraction of a *testing.T.

Jump to

Keyboard shortcuts

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