progress

package
v1.19.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package progress draws a live progress line for an integration test run.

It writes to the controlling terminal rather than to stdout. `go test` captures the test binary's stdout and stderr, and without -v throws away everything a passing test wrote, so a progress line sent there would never be seen. Writing to /dev/tty side steps that: the line appears on screen as the run proceeds, stays out of the output when it is piped to a file, and does not need the run to be verbose.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reporter

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

Reporter renders the progress of a run. The zero value, and any Reporter created when there is no terminal to draw on, is a no-op.

func New

func New(total int) *Reporter

New returns a Reporter drawing on the controlling terminal, or a no-op Reporter when there is not one to draw on.

func (*Reporter) Done

func (r *Reporter) Done(name string, failed bool)

Done records that a test case finished. A failure is also written out as a line of its own, so that failures accumulate on screen during a long run rather than only appearing at the end.

func (*Reporter) Finish

func (r *Reporter) Finish()

Finish removes the progress line, leaving the terminal as it found it.

Jump to

Keyboard shortcuts

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