Documentation
¶
Overview ¶
Package testinputs makes the repository files a test hands to a child process inputs of that test's cached result.
Go's test cache reuses a package's passing result while the test binary, its flags, the environment variables it read and the module files it opened or stat-ed are unchanged. A file that only a child process reads — a script run with sh or node, a docker build context, the sources of a binary built with go build — is not among them, so editing it alone would replay a stale pass. A test calls Files or GoBuild before starting that process: reading the files in the test process records them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Files ¶
Files reads every regular file under each path (a file or a directory, relative to the test's working directory), and lists every directory, so a changed, added or removed file changes the test's cache key.
func GoBuild ¶
GoBuild reads the sources of everything `go build pkgs...` run in dir compiles from this module (go list -deps, with the build's GOOS), so a change to a binary the test builds and runs in a child process changes the test's cache key, as a change to the test's own packages does. It returns the files it read.
Types ¶
This section is empty.