tools: golang.org/x/tools/internal/testenv Index | Files

package testenv

import "golang.org/x/tools/internal/testenv"

Package testenv contains helper functions for skipping tests based on which tools are present in the environment.

Index

Package Files

testenv.go testenv_112.go

func ExitIfSmallMachine Uses

func ExitIfSmallMachine()

ExitIfSmallMachine emits a helpful diagnostic and calls os.Exit(0) if the current machine is a builder known to have scarce resources.

It should be called from within a TestMain function.

func Go1Point Uses

func Go1Point() int

Go1Point returns the x in Go 1.x.

func NeedsGo1Point Uses

func NeedsGo1Point(t Testing, x int)

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

func NeedsGoBuild Uses

func NeedsGoBuild(t Testing)

NeedsGoBuild skips t if the current system can't build programs with “go build” and then run them with os.StartProcess or exec.Command. android, and darwin/arm systems don't have the userspace go build needs to run, and js/wasm doesn't support running subprocesses.

func NeedsGoPackages Uses

func NeedsGoPackages(t Testing)

NeedsGoPackages skips t if the go/packages driver (or 'go' tool) implied by the current process environment is not present in the path.

func NeedsGoPackagesEnv Uses

func NeedsGoPackagesEnv(t Testing, env []string)

NeedsGoPackagesEnv skips t if the go/packages driver (or 'go' tool) implied by env is not present in the path.

func NeedsTool Uses

func NeedsTool(t Testing, tool string)

NeedsTool skips t if the named tool is not present in the path. As a special case, "cgo" means "go" is present and can compile cgo programs.

func SkipAfterGo1Point Uses

func SkipAfterGo1Point(t Testing, x int)

SkipAfterGo1Point skips t if the Go version used to run the test is newer than 1.x.

type Testing Uses

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

Testing is an abstraction of a *testing.T.

Package testenv imports 10 packages (graph) and is imported by 9 packages. Updated 2020-07-09. Refresh now. Tools for package owners.