app

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 16 Imported by: 0 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(option Options) (int, error)

Types

type Options

type Options struct {
	// Output is used to write the final output, such as the tables, summary, etc.
	Output io.Writer
	// DisableColor will disable all colors.
	DisableColor bool
	// Format will set the output format for tables.
	Format OutputFormat
	// Sorter will set the sort order for the table.
	Sorter parse.PackageSorter
	// ShowNoTests will display packages containing no test files or empty test files.
	ShowNoTests bool
	// FileName will read test output from a file.
	FileName string

	// Test table options
	TestTableOptions    TestTableOptions
	SummaryTableOptions SummaryTableOptions

	// FollowOutput will follow the raw output as go test is running.
	FollowOutput        bool           // Output to stdout
	FollowOutputWriter  io.WriteCloser // Output to a file, takes precedence over FollowOutput
	FollowOutputVerbose bool

	// Progress will print a single summary line for each package once the package has completed.
	// Useful for long running test suites. Maybe used with FollowOutput or on its own.
	//
	// This will output to stdout.
	Progress       bool
	ProgressOutput io.Writer

	// DisableTableOutput will disable all table output. This is used for testing.
	DisableTableOutput bool

	// Compare includes a diff of a previous test output file in the summary table.
	Compare string

	// Used with FollowOutput, when enabled it would include timestamp with log lines
	IncludeTimestamp bool
}

type OutputFormat

type OutputFormat int
const (
	// OutputFormatBasic is a normal table without a border
	OutputFormatPlain OutputFormat = iota + 1
	// OutputFormatBasic is a normal table with border
	OutputFormatBasic
	// OutputFormatBasic is a markdown-rendered table
	OutputFormatMarkdown
)

type SummaryTableOptions added in v0.12.0

type SummaryTableOptions struct {
	// For narrow screens, remove common prefix and trim long package names vertically. Example:
	// github.com/mfridman/tparse/app
	// github.com/mfridman/tparse/internal/seed-up-down-to-zero
	//
	// tparse/app
	// tparse
	//  /seed-up-down-to-zero
	Trim bool

	// TrimPath is the path prefix to trim from the package name.
	TrimPath string
}

type TestTableOptions

type TestTableOptions struct {
	// Display passed or skipped tests. If both are true this is equivalent to all.
	Pass, Skip bool
	// For narrow screens, trim long test identifiers vertically. Example:
	// TestNoVersioning/seed-up-down-to-zero
	//
	// TestNoVersioning
	//  /seed-up-down-to-zero
	Trim bool

	// TrimPath is the path prefix to trim from the package name.
	TrimPath string

	// Display up to N slow tests for each package, tests are sorted by
	// calculated the elapsed time for the given test.
	Slow int
}

Jump to

Keyboard shortcuts

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