From: Sean Liao Date: Sat, 22 Mar 2025 00:48:16 +0000 (+0000) Subject: testing: document exit codes X-Git-Tag: go1.25rc1~605 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2bf57a3534f478d9c072391b1deba1d211545661;p=gostls13.git 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) Reviewed-by: Dmitri Shuralyov Reviewed-by: Damien Neil LUCI-TryBot-Result: Go LUCI --- diff --git a/src/testing/testing.go b/src/testing/testing.go index 5b0a33f28d..b03e6fdeda 100644 --- a/src/testing/testing.go +++ b/src/testing/testing.go @@ -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