]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: print the seed in TestRandLayout
authorCherry Mui <cherryyz@google.com>
Fri, 24 May 2024 17:18:50 +0000 (13:18 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 24 May 2024 20:26:02 +0000 (20:26 +0000)
When the test fails, print the seed, to help debug.

Change-Id: I1530ce433f3c6b573fbba061452f57c7649cad77
Reviewed-on: https://go-review.googlesource.com/c/go/+/587925
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/link/link_test.go

index ea377e77cc8fe160afd963513c3540224034fa6f..5fed6619c79dcf766a1c84e5a855fb0c2f4e777f 100644 (file)
@@ -1397,17 +1397,17 @@ func TestRandLayout(t *testing.T) {
                cmd := testenv.Command(t, testenv.GoToolPath(t), "build", "-ldflags=-randlayout="+seed, "-o", exe, src)
                out, err := cmd.CombinedOutput()
                if err != nil {
-                       t.Fatalf("build failed: %v\n%s", err, out)
+                       t.Fatalf("seed=%v: build failed: %v\n%s", seed, err, out)
                }
                cmd = testenv.Command(t, exe)
                err = cmd.Run()
                if err != nil {
-                       t.Fatalf("executable failed to run: %v\n%s", err, out)
+                       t.Fatalf("seed=%v: executable failed to run: %v\n%s", seed, err, out)
                }
                cmd = testenv.Command(t, testenv.GoToolPath(t), "tool", "nm", exe)
                out, err = cmd.CombinedOutput()
                if err != nil {
-                       t.Fatalf("fail to run \"go tool nm\": %v\n%s", err, out)
+                       t.Fatalf("seed=%v: fail to run \"go tool nm\": %v\n%s", seed, err, out)
                }
                syms[i] = string(out)
        }