package require

import "github.com/Microsoft/hcsshim/test/pkg/require"

Index

Functions

func AnyFeature

func AnyFeature(tb testing.TB, given *flag.IncludeExcludeStringSet, want ...string)

AnyFeature checks if at least one of the features are enabled.

See Features for more information.

func Binary

func Binary(tb testing.TB, binary string) string

Binary checks if `binary` exists in the same directory as the test binary. Returns full binary path if it exists, otherwise, skips the test.

func BinaryInPath

func BinaryInPath(tb testing.TB, binary string) string

Binary tries to locate `binary` in the PATH (or the current working directory), or the same the same directory as the currently-executing binary.

Returns full binary path if it exists, otherwise, skips the test.

func Features

func Features(tb testing.TB, given *flag.IncludeExcludeStringSet, want ...string)

Features checks the wanted features are present in given, and skips the test if any are missing or explicitly excluded. If the given set is empty, the function returns (by default, all features are enabled).

See flag.NewFeatureFlag and flag.IncludeExcludeStringSet for more details.

func File

func File(tb testing.TB, path, file string) string

File checks if `file` exists in `path`, and returns the full path if it exists. Otherwise, it skips the test.

Source Files

requires.go

Version
v0.0.0-20250605171046-9b2e94f54499 (latest)
Published
Jun 5, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
21 minutes ago

Tools for package owners.