cli

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitCode added in v0.4.0

func ExitCode(err error) int

ExitCode returns process exit code for a CLI error.

func Run

func Run(args []string) error

Types

type TestFixture added in v0.11.0

type TestFixture struct {
	Name           string `json:"name"`
	Input          string `json:"input"`
	ExpectedStatus string `json:"expected_status"`
	ExpectedOutput string `json:"expected_output"`
	Timeout        string `json:"timeout"`
}

TestFixture is a single test case read from a JSON fixture file.

func LoadFixtures added in v0.11.0

func LoadFixtures(dir string) ([]TestFixture, error)

LoadFixtures reads all JSON fixture files from a directory.

type TestResult added in v0.11.0

type TestResult struct {
	Fixture  TestFixture
	Passed   bool
	Output   string
	Status   string
	Duration time.Duration
	Error    string
}

TestResult holds the outcome of running a single fixture.

type WASMTestRunner added in v0.11.0

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

WASMTestRunner executes WASM tool modules against test fixtures.

func NewWASMTestRunner added in v0.11.0

func NewWASMTestRunner(modulePath string, fuelBudget uint64, memBudget int64) *WASMTestRunner

NewWASMTestRunner creates a test runner for the given module.

func (*WASMTestRunner) RunAll added in v0.11.0

func (r *WASMTestRunner) RunAll(ctx context.Context, fixtures []TestFixture) []TestResult

RunAll executes each fixture against the WASM module and returns results.