test

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GoBuild

func GoBuild(t *testing.T, dir, tags string, strip bool, envVarVals ...string) (binaryPath string, cleanup func())

GoBuild runs "go build" on dir using the additional environment variables in envVarVals, which should be an alternating list of variables and values. It returns the path to the resulting binary, and a function to call when finished with the binary.

func LoadPackages

func LoadPackages(e *packagestest.Exported, patterns ...string) ([]*packages.Package, error)

LoadPackages loads packages for patterns. Returns error if the loading failed or some of the specified packages have issues. In the latter case, the error message will contain information only for the first observed package with issues.

func NeedsGoEnv

func NeedsGoEnv(t testing.TB)

NeedsGoEnv skips t if the current system can't get the environment with “go env” in a subprocess.

func VerifyImports

func VerifyImports(t *testing.T, allowed ...string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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