testenv

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

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 Go1Point

func Go1Point() int

Go1Point returns the x in Go 1.x.

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.

func NeedsTool

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.

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