cov

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CovDataReaderNoFlags CovDataReaderFlags = 0
	PanicOnError                            = 1 << iota
	PanicOnWarning
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CovDataReader

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

CovDataReader is a general-purpose helper/visitor object for reading coverage data files in a structured way. Clients create a CovDataReader to process a given collection of coverage data file directories, then pass in a visitor object with methods that get invoked at various important points. CovDataReader is intended to facilitate common coverage data file operations such as merging or intersecting data files, analyzing data files, or dumping data files.

func MakeCovDataReader

func MakeCovDataReader(vis CovDataVisitor, indirs []string, verbosityLevel int, flags CovDataReaderFlags, matchpkg func(name string) bool) *CovDataReader

MakeCovDataReader creates a CovDataReader object to process the given set of input directories. Here 'vis' is a visitor object providing methods to be invoked as we walk through the data, 'indirs' is the set of coverage data directories to examine, 'verbosityLevel' controls the level of debugging trace messages (zero for off, higher for more output), 'flags' stores flags that indicate what to do if errors are detected, and 'matchpkg' is a caller-provided function that can be used to select specific packages by name (if nil, then all packages are included).

func (*CovDataReader) Visit

func (r *CovDataReader) Visit() error

type CovDataReaderFlags

type CovDataReaderFlags uint32

type CovDataVisitor

type CovDataVisitor interface {
	BeginPod(p pods.Pod)
	EndPod(p pods.Pod)

	VisitMetaDataFile(mdf string, mfr *decodemeta.CoverageMetaFileReader)

	BeginCounterDataFile(cdf string, cdr *decodecounter.CounterDataReader, dirIdx int)
	EndCounterDataFile(cdf string, cdr *decodecounter.CounterDataReader, dirIdx int)

	VisitFuncCounterData(payload decodecounter.FuncPayload)

	EndCounters()

	BeginPackage(pd *decodemeta.CoverageMetaDataDecoder, pkgIdx uint32)
	EndPackage(pd *decodemeta.CoverageMetaDataDecoder, pkgIdx uint32)

	VisitFunc(pkgIdx uint32, fnIdx uint32, fd *coverage.FuncDesc)

	Finish()
}

type MReader

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

func NewMreader

func NewMreader(f *os.File) (*MReader, error)

func (*MReader) Read

func (r *MReader) Read(p []byte) (int, error)

func (*MReader) ReadByte

func (r *MReader) ReadByte() (byte, error)

func (*MReader) Seek

func (r *MReader) Seek(offset int64, whence int) (int64, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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