Help us shape the future of Go! Take the 2026 Go Developer Survey

testtools

package
v0.21.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package testtools gives tests one policy for external tools (spirv-val, spirv-dis, dxc, ...), in the spirit of Go's internal/testenv.

Locally, a missing tool skips the check that needs it, with an explicit reason. In CI, NAGA_REQUIRE_TOOLS lists tools that must be present ("spirv-val,spirv-dis", or "all"): a missing listed tool fails the test, so a runner without the tool cannot report green while checking nothing.

Index

Constants

View Source
const (
	InstallSPIRVTools = "install SPIRV-Tools, e.g. from the Vulkan SDK"
	InstallDXC        = "install the Windows SDK or put dxc in PATH"
)

Install hints shared by callers.

View Source
const EnvRequired = "NAGA_REQUIRE_TOOLS"

EnvRequired names the environment variable listing required tools.

Variables

This section is empty.

Functions

func Look

func Look(t T, name, install string) string

Look returns the path of a tool the test cannot run without. If it is missing, the test fails when the tool is required and is skipped otherwise.

func Missing

func Missing(t T, name, install string)

Missing reports a tool that a test-specific lookup could not find, with Look's policy: fail when required, skip otherwise.

func Optional

func Optional(t T, name, install string) (string, bool)

Optional returns the path of a tool one part of a test needs, and whether it was found. If it is missing, the test fails when the tool is required; otherwise the absence is logged and the rest of the test goes on.

func Required

func Required(name string) bool

Required reports whether name is listed in NAGA_REQUIRE_TOOLS.

Types

type T

type T interface {
	Helper()
	Fatalf(format string, args ...any)
	Skipf(format string, args ...any)
	Logf(format string, args ...any)
}

T is the subset of testing.TB these helpers use.

Jump to

Keyboard shortcuts

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