mlxthreadtest

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package mlxthreadtest runs tests on a persistent MLX worker thread.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, thread *Thread, fn func(*T))

Run executes fn on thread. The callback must use its T argument; calling FailNow or SkipNow on a captured *testing.T terminates the pinned worker.

Types

type T

type T struct {
	// contains filtered or unexported fields
}

T is the subset of testing.T supported by MLX test bodies. Operations that end a test are replayed by Run on the test goroutine so the MLX worker remains alive.

func (*T) Cleanup

func (t *T) Cleanup(fn func())

Cleanup registers fn to run on the MLX thread after the current body.

func (*T) FailNow

func (t *T) FailNow()

func (*T) Fatal

func (t *T) Fatal(args ...any)

func (*T) Fatalf

func (t *T) Fatalf(format string, args ...any)

func (*T) Skip

func (t *T) Skip(args ...any)

func (*T) SkipNow

func (t *T) SkipNow()

func (*T) Skipf

func (t *T) Skipf(format string, args ...any)

func (*T) Skipped

func (t *T) Skipped() bool

type Thread

type Thread struct {
	// contains filtered or unexported fields
}

Thread is a pinned worker used by MLX tests.

func Start

func Start(name string, init func() error) (*Thread, error)

Start creates a pinned test worker.

func (*Thread) Do

func (t *Thread) Do(ctx context.Context, fn func() error) error

Do runs fn on the pinned worker.

func (*Thread) Stop

func (t *Thread) Stop(ctx context.Context, cleanup func()) error

Stop shuts down the pinned worker after running cleanup on it.

Jump to

Keyboard shortcuts

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