Help us shape the future of Go! Take the 2026 Go Developer Survey

termtest

package
v0.0.204 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAgentTerm

func BuildAgentTerm(t *testing.T, start string) string

BuildAgentTerm builds the agent-term binary for doctest harnesses. start is typically d.DOCTEST_ROOT so the walk can find the repo-root go.mod even when the generated test's cwd is a temp directory.

func PickFreePort

func PickFreePort(base int) (int, error)

PickFreePort finds an available TCP port near base.

Types

type Request

type Request struct {
	Phase string

	Args       []string
	ListenAddr string
	DaemonPort int

	StartDaemon        bool
	EnsureNoDaemon     bool
	RenameBeforeAttach string
	WebSessionName     string
	RunCommand         []string
	DetachSignal       bool
	RunProbeSeconds    int
	RequireGrok        bool

	AgentTermBin string
	DaemonAddr   string
}

Request is the doctest harness request for agent-term CLI tests.

type Response

type Response struct {
	ExitCode   int
	Stdout     string
	Stderr     string
	Combined   string
	HTTPStatus int
	HTTPBody   string
	DaemonPort int

	DaemonStderr        string
	SessionStillRunning bool
	DetachedSessionID   string
}

Response is the doctest harness response for agent-term CLI tests.

func Run

func Run(t *testing.T, req *Request) (*Response, error)

Run executes an agent-term doctest phase.

Jump to

Keyboard shortcuts

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