cltest

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 31 Imported by: 1 module, 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAndCheckSymbolsFromDir

func BuildAndCheckSymbolsFromDir(t *testing.T, sel, relDir string, names []string, opts ...RunOption)

BuildAndCheckSymbolsFromDir builds the named tests under relDir and validates SYMBOL FileCheck directives against the linked binary symbol table.

func CaptureMeta

func CaptureMeta(relPkg, pkgDir string) (string, error)

CaptureMeta builds relPkg and returns the package metadata captured for pkgDir.

func CompileIREx

func CompileIREx(t *testing.T, src any, fname string, dbg bool, configure func(llssa.Program)) string

func FilterEmulatorOutput

func FilterEmulatorOutput(output string) string

FilterEmulatorOutput strips emulator boot logs by returning output after "entry 0x...".

func FromDir

func FromDir(t *testing.T, sel, relDir string)

func InitDebug

func InitDebug()

func IsOutputMarker added in v1.0.10

func IsOutputMarker(data []byte) bool

IsOutputMarker reports whether data selects run-only or IR-only execution. A marker permits one final LF or CRLF, but no other surrounding whitespace.

func Pkg

func Pkg(t *testing.T, pkgPath, outFile string)

func ReadGolden added in v1.0.10

func ReadGolden(file string) (string, []byte, error)

ReadGolden reads the toolchain-specific golden when present, otherwise file. It returns the selected path so refresh tools update the same file tests use.

func RunAndCapture

func RunAndCapture(relPkg, pkgDir string) ([]byte, error)

func RunAndCaptureWithConf

func RunAndCaptureWithConf(relPkg, pkgDir string, conf *build.Config) ([]byte, error)

RunAndCaptureWithConf runs llgo with a custom build config and captures output.

func RunAndTestFromDir

func RunAndTestFromDir(t *testing.T, sel, relDir string, ignore []string, opts ...RunOption)

RunAndTestFromDir executes tests under relDir and validates both runtime output and the pre-transform package IR snapshot when the corresponding golden files exist.

func TestCompileEx

func TestCompileEx(t *testing.T, src any, fname, expected string, dbg bool)

Types

type RunOption

type RunOption func(*runOptions)

RunOption customizes directory-based test behavior.

func WithIRCheck

func WithIRCheck(enabled bool) RunOption

WithIRCheck enables or disables IR golden checks in RunAndTestFromDir.

func WithMetaCheck

func WithMetaCheck(enabled bool) RunOption

WithMetaCheck enables or disables package metadata golden checks.

func WithOutputCheck

func WithOutputCheck(enabled bool) RunOption

WithOutputCheck enables runtime tests selected by expect.txt. Disabling it leaves IR checks enabled; metadata checks can still require execution.

func WithOutputFilter

func WithOutputFilter(filter func(string) string) RunOption

WithOutputFilter applies a filter to output before comparison.

func WithRunConfig

func WithRunConfig(conf *build.Config) RunOption

WithRunConfig uses the provided build config for test runs.

Jump to

Keyboard shortcuts

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