Skip to content

Commit 23778fc

Browse files
committed
cmd/link: print the seed in TestRandLayout
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 <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 54efef9 commit 23778fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cmd/link/link_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,17 +1397,17 @@ func TestRandLayout(t *testing.T) {
13971397
cmd := testenv.Command(t, testenv.GoToolPath(t), "build", "-ldflags=-randlayout="+seed, "-o", exe, src)
13981398
out, err := cmd.CombinedOutput()
13991399
if err != nil {
1400-
t.Fatalf("build failed: %v\n%s", err, out)
1400+
t.Fatalf("seed=%v: build failed: %v\n%s", seed, err, out)
14011401
}
14021402
cmd = testenv.Command(t, exe)
14031403
err = cmd.Run()
14041404
if err != nil {
1405-
t.Fatalf("executable failed to run: %v\n%s", err, out)
1405+
t.Fatalf("seed=%v: executable failed to run: %v\n%s", seed, err, out)
14061406
}
14071407
cmd = testenv.Command(t, testenv.GoToolPath(t), "tool", "nm", exe)
14081408
out, err = cmd.CombinedOutput()
14091409
if err != nil {
1410-
t.Fatalf("fail to run \"go tool nm\": %v\n%s", err, out)
1410+
t.Fatalf("seed=%v: fail to run \"go tool nm\": %v\n%s", seed, err, out)
14111411
}
14121412
syms[i] = string(out)
14131413
}

0 commit comments

Comments
 (0)