Documentation ¶
Overview ¶
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
It is an internal package because these details are specific to the Go team's test setup (on build.golang.org) and not fundamental to tests in general.
Index ¶
- func Builder() string
- func CleanCmdEnv(cmd *exec.Cmd) *exec.Cmd
- func GoTool() (string, error)
- func GoToolPath(t testing.TB) string
- func HasCGO() bool
- func HasExec() bool
- func HasExternalNetwork() bool
- func HasGoBuild() bool
- func HasGoRun() bool
- func HasLink() bool
- func HasSrc() bool
- func HasSymlink() bool
- func MustHaveCGO(t testing.TB)
- func MustHaveExec(t testing.TB)
- func MustHaveExecPath(t testing.TB, path string)
- func MustHaveExternalNetwork(t testing.TB)
- func MustHaveGoBuild(t testing.TB)
- func MustHaveGoRun(t testing.TB)
- func MustHaveLink(t testing.TB)
- func MustHaveSymlink(t testing.TB)
- func SkipFlaky(t testing.TB, issue int)
- func SkipFlakyNet(t testing.TB)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Builder ¶
func Builder() string
Builder reports the name of the builder running this test (for example, "linux-amd64" or "windows-386-gce"). If the test is not running on the build infrastructure, Builder returns the empty string.
func CleanCmdEnv ¶ added in go1.10
CleanCmdEnv will fill cmd.Env with the environment, excluding certain variables that could modify the behavior of the Go tools such as GODEBUG and GOTRACEBACK.
func GoToolPath ¶ added in go1.7
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 HasCGO ¶ added in go1.10
func HasCGO() bool
HasCGO reports whether the current system can use cgo.
func HasExec ¶
func HasExec() bool
HasExec reports whether the current system can start new processes using os.StartProcess or (more commonly) exec.Command.
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 HasGoRun ¶
func HasGoRun() bool
HasGoRun reports whether the current system can run programs with “go run.”
func HasLink ¶ added in go1.8
func HasLink() bool
HasLink reports whether the current system can use os.Link.
func HasSrc ¶ added in go1.9
func HasSrc() bool
HasSrc reports whether the entire source tree is available under GOROOT.
func HasSymlink ¶ added in go1.8
func HasSymlink() bool
HasSymlink reports whether the current system can use os.Symlink.
func MustHaveCGO ¶ added in go1.8.1
MustHaveCGO calls t.Skip if cgo is not available.
func MustHaveExec ¶
MustHaveExec checks that the current system can start new processes using os.StartProcess or (more commonly) exec.Command. If not, MustHaveExec calls t.Skip with an explanation.
func MustHaveExecPath ¶ added in go1.13
MustHaveExecPath checks that the current system can start the named executable using os.StartProcess or (more commonly) exec.Command. If not, MustHaveExecPath calls t.Skip with an explanation.
func MustHaveExternalNetwork ¶
MustHaveExternalNetwork checks that the current system can use external (non-localhost) networks. If not, MustHaveExternalNetwork calls t.Skip with an explanation.
func MustHaveGoBuild ¶
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 MustHaveGoRun ¶
MustHaveGoRun checks that the current system can run programs with “go run.” If not, MustHaveGoRun calls t.Skip with an explanation.
func MustHaveLink ¶ added in go1.8
MustHaveLink reports whether the current system can use os.Link. If not, MustHaveLink calls t.Skip with an explanation.
func MustHaveSymlink ¶ added in go1.8
MustHaveSymlink reports whether the current system can use os.Symlink. If not, MustHaveSymlink calls t.Skip with an explanation.
func SkipFlakyNet ¶ added in go1.7
Types ¶
This section is empty.