Documentation
¶
Overview ¶
Package reexectest lets a test observe every execution of its own test binary without recursing. A `go test` binary started with charly arguments ignores them and re-runs its whole suite, so a test that reaches an exec of the running binary (proc.RunCharlySubcommand, a build from the running charly) would recurse; with Record at the top of TestMain such a child appends its arguments to a log and exits instead.
Index ¶
Constants ¶
const ExitCode = 3
ExitCode is the status a recorded re-execution exits with.
Variables ¶
This section is empty.
Functions ¶
func Log ¶
Log points this test's re-executions at a fresh log and returns a reader of the arguments recorded so far, one execution per line ("" when the binary was never executed).
func Main ¶ added in v0.2026339.1557
Main is the suite-wide TestMain body for a package whose tests may re-execute the test binary. It records every child re-execution at ONE per-run log before m.Run — so a re-execution reached from any test is logged and exits with ExitCode instead of re-running the suite — and fails the run when that log is non-empty: a test that re-executes the binary must opt in with Log(t), and a path that does so without it fails loudly rather than recursing through the whole suite.
Types ¶
This section is empty.