bzltestutil

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const TestWrapperAbnormalExit = 6

TestWrapperAbnormalExit is used by Wrap to indicate the child process exitted without an exit code (for example being killed by a signal). We use 6, in line with Bazel's RUN_FAILURE.

Variables

View Source
var (
	// Initialized by linker.
	RunDir string
)

Functions

func NewConverter

func NewConverter(w io.Writer, pkg string, mode Mode) io.WriteCloser

NewConverter returns a "test to json" converter. Writes on the returned writer are written as JSON to w, with minimal delay.

The writes to w are whole JSON events ending in \n, so that it is safe to run multiple tests writing to multiple converters writing to a single underlying output stream w. As long as the underlying output w can handle concurrent writes from multiple goroutines, the result will be a JSON stream describing the relative ordering of execution in all the concurrent tests.

The mode flag adjusts the behavior of the converter. Passing ModeTime includes event timestamps and elapsed times.

The pkg string, if present, specifies the import path to report in the JSON stream.

func ShouldWrap

func ShouldWrap() bool

func Wrap

func Wrap(pkg string) error

Types

type Mode

type Mode int

Mode controls details of the conversion.

const (
	Timestamp Mode = 1 << iota // include Time in events
)

Jump to

Keyboard shortcuts

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