coverage

package standard library
go1.21.3 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const CounterFilePref = "covcounters"

CounterFilePref is the file prefix used when emitting coverage data output files. CounterFileTemplate describes the format of the file name: prefix followed by meta-file hash followed by process ID followed by emit UnixNanoTime.

View Source
const CounterFileRegexp = `^%s\.(\S+)\.(\d+)\.(\d+)+$`
View Source
const CounterFileTempl = "%s.%x.%d.%d"
View Source
const CounterFileVersion = 1

CounterFileVersion stores the most recent counter data file version.

View Source
const CovMetaHeaderSize = 16 + 4 + 4 + 4 + 4 + 4 + 4 + 4 // keep in sync with above
View Source
const FirstCtrOffset = 3
View Source
const FuncIdOffset = 2
View Source
const MetaFilePref = "covmeta"

MetaFilePref is a prefix used when emitting meta-data files; these files are of the form "covmeta.<hash>", where hash is a hash computed from the hashes of all the package meta-data symbols in the program.

View Source
const MetaFileVersion = 1

MetaFileVersion contains the current (most recent) meta-data file version.

View Source
const MetaFilesFileName = "metafiles.txt"

Name of file within the "go test -cover" temp coverdir directory containing a list of meta-data files for packages being tested in a "go test -coverpkg=... ..." run. This constant is shared by the Go command and by the coverage runtime.

View Source
const NotHardCoded = -1

NotHardCoded is a package pseudo-ID indicating that a given package is not part of the runtime and doesn't require a hard-coded ID.

View Source
const NumCtrsOffset = 0
View Source
const PkgIdOffset = 1

Variables

View Source
var CovCounterMagic = [4]byte{'\x00', '\x63', '\x77', '\x6d'}

CovCounterMagic holds the magic string for a coverage counter-data file.

View Source
var CovMetaMagic = [4]byte{'\x00', '\x63', '\x76', '\x6d'}

CovMetaMagic holds the magic string for a meta-data file.

Functions

func HardCodedPkgID

func HardCodedPkgID(pkgpath string) int

HardCodedPkgID returns the hard-coded ID for the specified package path, or -1 if we don't use a hard-coded ID. Hard-coded IDs start at -2 and decrease as we go down the list.

func