testenv

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package testenv says where the integration tests find their data: libspeech, the models and the audio that cmd/speech-testdata builds under the module's .cache directory, or what SPEECH_CPP_LIB, SPEECH_CPP_MODELS and SPEECH_CPP_AUDIO name instead. SPEECH_CPP_USER_AGENT, when set, is the User-Agent of the tests that reach the network. SPEECH_CPP_REQUIRE_ALL, when true, makes a missing optional model fail its test instead of skipping it.

Index

Constants

View Source
const (
	EnvLib       = "SPEECH_CPP_LIB"
	EnvModels    = "SPEECH_CPP_MODELS"
	EnvAudio     = "SPEECH_CPP_AUDIO"
	EnvUserAgent = "SPEECH_CPP_USER_AGENT"
	// EnvRequireAll is read by RequireAll.
	EnvRequireAll = "SPEECH_CPP_REQUIRE_ALL"
)

The environment variables the integration tests read.

Variables

This section is empty.

Functions

func AudioDir

func AudioDir(moduleRoot string) string

AudioDir is SPEECH_CPP_AUDIO, or <moduleRoot>/.cache/audio.

func CacheDir

func CacheDir(moduleRoot string) string

CacheDir is <moduleRoot>/.cache, where cmd/speech-testdata builds the data.

func HostTarget

func HostTarget() download.Target

HostTarget is the running platform with the backend of the build speech.cpp publishes for its OS: Metal on macOS, CPU on Linux, Vulkan on Windows. Its Platform method fails on a platform with no published build.

func LibPath

func LibPath(moduleRoot string) string

LibPath is SPEECH_CPP_LIB, or the host target's library installed under <moduleRoot>/.cache/lib/<platform>.

func ModelsDir

func ModelsDir(moduleRoot string) string

ModelsDir is SPEECH_CPP_MODELS, or <moduleRoot>/.cache/models.

func RequireAll

func RequireAll() bool

RequireAll reports whether SPEECH_CPP_REQUIRE_ALL is set to a true value (strconv.ParseBool: 1, t, true, ...): a missing optional model then fails its test instead of skipping it. Unset, empty or unparsable means false.

func UserAgent

func UserAgent() string

UserAgent is SPEECH_CPP_USER_AGENT; empty means the download package's default.

Types

This section is empty.

Jump to

Keyboard shortcuts

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