runtime: if runtime is stale while testing, show StaleReason

Update #19062.

Change-Id: I7397b573389145b56e73d2150ce0fc9aa75b3caa
Reviewed-on: https://go-review.googlesource.com/36934
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Ian Lance Taylor 2017-02-13 15:30:42 -08:00
parent efb3cab960
commit 62237c2c8e

View file

@ -165,6 +165,11 @@ func checkStaleRuntime(t *testing.T) {
}
if string(out) != "false\n" {
t.Logf("go list -f {{.Stale}} runtime:\n%s", out)
out, err := testEnv(exec.Command(testenv.GoToolPath(t), "list", "-f", "{{.StaleReason}}", "runtime")).CombinedOutput()
if err != nil {
t.Logf("go list -f {{.StaleReason}} failed: %v", err)
}
t.Logf("go list -f {{.StaleReason}} runtime:\n%s", out)
staleRuntimeErr = fmt.Errorf("Stale runtime.a. Run 'go install runtime'.")
}
})