runner

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: Apache-2.0 Imports: 3 Imported by: ? 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 runner decides pass/fail for `srig run` from streamed serial output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaluator

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

Evaluator matches serial lines against the sentinel and optional patterns.

func NewEvaluator

func NewEvaluator(expect, fail string) (*Evaluator, error)

NewEvaluator compiles the optional expect/fail regexes (empty string = unset).

func (*Evaluator) Feed

func (e *Evaluator) Feed(line string) (Outcome, bool)

Feed evaluates one line of serial output. It returns (outcome, true) when a terminal condition is reached; precedence is sentinel > fail > expect.

func (*Evaluator) Timeout

func (e *Evaluator) Timeout() Outcome

Timeout is the outcome when the watch window elapses with no terminal line: a fail if --expect was set (never matched), otherwise a clean pass.

type Outcome

type Outcome struct {
	ExitCode int
	Reason   string // "sentinel" | "fail" | "expect" | "timeout" | "ran"
	Matched  string
}

Outcome is the terminal result of a run.

type Result

type Result struct {
	Result    string `json:"result"` // "pass" | "fail"
	ExitCode  int    `json:"exit_code"`
	Reason    string `json:"reason"`
	Matched   string `json:"matched,omitempty"`
	SessionID string `json:"session_id"`
}

Result is the machine-readable form of an Outcome for --json.

func ResultFrom

func ResultFrom(o Outcome, sessionID string) Result

ResultFrom maps an Outcome (exit 0 = pass) to a Result.

Jump to

Keyboard shortcuts

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