]> Cypherpunks repositories - gostls13.git/commitdiff
testing: document exit codes
authorSean Liao <sean@liao.dev>
Sat, 22 Mar 2025 00:48:16 +0000 (00:48 +0000)
committerSean Liao <sean@liao.dev>
Tue, 25 Mar 2025 18:52:07 +0000 (11:52 -0700)
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>

src/testing/testing.go

index 5b0a33f28d4db2c6083651cf188e753534950374..b03e6fdeda6d62c080cb9b1567f7ec778878a0c0 100644 (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