Documentation
¶
Overview ¶
Package testbuild reports how the test binary was built.
Index ¶
Constants ¶
const AllocBudgetsHold = !debug.Enabled && !Race
AllocBudgetsHold reports a build whose instrumentation does not allocate: neither lysdebug, whose traces allocate, nor -race.
const Race = false
Race reports a build with the race detector.
Variables ¶
This section is empty.
Functions ¶
func GoroutineID ¶
func GoroutineID() uint64
GoroutineID is the calling goroutine's id, parsed from its stack header.
func RequireNoInit ¶
RequireNoInit fails the test of a package that runs code when it is initialised: a package-level variable the compiler cannot lay out statically (one computed by a call, a map, a slice of another variable) or an init function, in the package or the test files that share its name. A program that imports the package pays for that before main, whether or not it ever uses what was built. The check reads the runtime's init trace of the test binary, which lists only the packages that have such code. It names the package by its caller, so a test calls it directly:
func TestImportingCostsNothing(t *testing.T) { testbuild.RequireNoInit(t) }
func SkipAllocBudget ¶
SkipAllocBudget skips an allocation budget in a build whose instrumentation allocates.
Types ¶
This section is empty.