testing: document exit codes

Fixes #25989

Change-Id: I2e2a2a17854034ff68e69b8973018b1b2e7d59f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/660076
Reviewed-by: Thanyalak Detkhong (Palm’my) <pmy4416@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Sean Liao 2025-03-22 00:48:16 +00:00
parent 936bb82ddb
commit 2bf57a3534

View File

@ -2043,6 +2043,9 @@ var testingTesting bool
var realStderr *os.File
// Run runs the tests. It returns an exit code to pass to os.Exit.
// The exit code is zero when all tests pass, and non-zero for any kind
// of failure. For machine readable test results, parse the output of
// 'go test -json'.
func (m *M) Run() (code int) {
defer func() {
code = m.exitCode