toolshonnef.co/go/tools/internal/testenv Index | Files

package testenv

import "honnef.co/go/tools/internal/testenv"

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

Index

Functions

func ExitIfSmallMachine

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 NeedsGoPackages

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

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

func NeedsTool(t Testing, tool string)

NeedsTool skips t if the named tool is not present in the path.

Types

type Testing

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

Testing is an abstraction of a *testing.T.

Source Files

testenv.go testenv_112.go

Version
v0.2.0-0.dev
Published
Dec 14, 2020
Platform
js/wasm
Imports
8 packages
Last checked
3 minutes ago

Tools for package owners.