]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: add detail to test failures
authorBryan C. Mills <bcmills@google.com>
Fri, 28 Jan 2022 21:18:22 +0000 (16:18 -0500)
committerBryan Mills <bcmills@google.com>
Tue, 1 Feb 2022 20:55:43 +0000 (20:55 +0000)
For #50892

Change-Id: I14ff1c43b39687a0ba5e668ee962cecfb49e4beb
Reviewed-on: https://go-review.googlesource.com/c/go/+/381836
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/go/go_test.go
src/cmd/go/script_test.go

index 7aaec4eb9864e8a3bd50ef5fa146eff5625ac5df..1ea347ca6e5dbd2d7a8cabf362c3586bd4583bcd 100644 (file)
@@ -133,7 +133,7 @@ func TestMain(m *testing.M) {
                }
                gotool, err := testenv.GoTool()
                if err != nil {
-                       fmt.Fprintln(os.Stderr, err)
+                       fmt.Fprintln(os.Stderr, "locating go tool: ", err)
                        os.Exit(2)
                }
 
index 165d3308a8ec1746deb186bf0fb6c45ae30a5998..722921f74c3d34f371ae325a09001d94039d56ce 100644 (file)
@@ -902,7 +902,7 @@ func (ts *testScript) cmdStale(want simpleStatus, args []string) {
        tmpl := "{{if .Error}}{{.ImportPath}}: {{.Error.Err}}{{else}}"
        switch want {
        case failure:
-               tmpl += "{{if .Stale}}{{.ImportPath}} is unexpectedly stale{{end}}"
+               tmpl += "{{if .Stale}}{{.ImportPath}} is unexpectedly stale: {{.StaleReason}}{{end}}"
        case success:
                tmpl += "{{if not .Stale}}{{.ImportPath}} is unexpectedly NOT stale{{end}}"
        default: