Documentation
¶
Overview ¶
Package testcount counts the expensive operations that test helpers start and prints the counts of a package at the end of its test run, for internal/testtime to check against testdata/test-time-budget.txt.
Index ¶
Constants ¶
const ( Servers = "servers" Schemas = "schemas" Processes = "processes" )
The names of the counts.
const Prefix = "motte-testcount "
Prefix starts the one output line that carries the counts of a package.
Variables ¶
This section is empty.
Functions ¶
func Add ¶
Add counts one operation. In a package of this module that does not call Run from its TestMain, it fails the test, because the count would be lost.
func AtExit ¶ added in v0.19.0
func AtExit(f func()) bool
AtExit registers f to run after the tests of the package, before Run prints the counts. It reports false, and does not register f, when the package does not call Run from its TestMain.
func Line ¶
Line renders the count line for the counts of runs runs of the tests. Each count is divided by runs, rounded up.
Types ¶
This section is empty.