package testenv
import "golang.org/x/telemetry/internal/testenv"
Package testenv contains helper functions for skipping tests based on which tools are present in the environment.
Index ¶
- func Go1Point() int
- func HasGo() error
- func MustHaveExec(t testing.TB)
- func NeedsGo(t testing.TB)
- func NeedsGo1Point(t testing.TB, x int)
- func NeedsLocalhostNet(t testing.TB)
- func SkipIfUnsupportedPlatform(t testing.TB)
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 ¶
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 ¶
NeedsGo skips t if the current system does not have 'go' or cannot run them with exec.Command.
func NeedsGo1Point ¶
NeedsGo1Point skips t if the Go version used to run the test is older than 1.x.
func NeedsLocalhostNet ¶
NeedsLocalhostNet skips t if networking does not work for ports opened with "localhost".
func SkipIfUnsupportedPlatform ¶
SkipIfUnsupportedPlatform skips test if the current os/arch are not support.
Source Files ¶
testenv.go
- Version
- v0.0.0-20250214215356-6f9b61db478c (latest)
- Published
- Feb 14, 2025
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 3 days ago –
Tools for package owners.