Documentation
¶
Overview ¶
Package testinputs puts a subprocess's source files into the calling test's Go test cache key.
Go keys a cached test result on the test binary and on the files and directories the test itself opened. A test that runs `go run <module>/cmd/gofastr` depends on the generator's source, but the subprocess's reads are not the test's, so after the generator changes Go replays the old result. cmd/affected already adds the edge for package selection (addCommandRuns); this adds it to the cache key.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
Command lists every package in the main module that importPath builds from, itself included, and reads each one's directory, its embedded files, and every directory between the two. Go's test cache records those reads: a directory's listing carries each entry's name, size and mtime, so an edited, added or removed source file changes the key. It returns the paths it read.
Call it in the test that runs the command, before or after the run.
Types ¶
This section is empty.