testenv

package
v0.0.0-...-5e7a336 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: BSD-3-Clause Imports: 8 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 Go1Point

func Go1Point() int

Go1Point returns the x in Go 1.x.

func HasGo

func HasGo() error

HasGo checks whether the current system has 'go'.

func MustHaveExec

func MustHaveExec(t testing.TB)

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 NeedsGo

func NeedsGo(t testing.TB)

NeedsGo skips t if the current system does not have 'go' or cannot run them with exec.Command.

func NeedsGo1Point

func NeedsGo1Point(t testing.TB, x int)

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

func NeedsLocalhostNet

func NeedsLocalhostNet(t testing.TB)

NeedsLocalhostNet skips t if networking does not work for ports opened with "localhost".

func SkipIfUnsupportedPlatform

func SkipIfUnsupportedPlatform(t testing.TB)

SkipIfUnsupportedPlatform skips test if the current os/arch are not support.

Types

This section is empty.

Jump to

Keyboard shortcuts

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