diff options
| author | Cherry Mui <cherryyz@google.com> | 2026-03-24 16:53:12 -0400 |
|---|---|---|
| committer | Cherry Mui <cherryyz@google.com> | 2026-03-24 18:03:02 -0700 |
| commit | e26d743e2b600e448bee8f9cafd57ba4a70df813 (patch) | |
| tree | 85178e0b20bf74ef97a08bae2f1af7218dc5f13c /src/cmd | |
| parent | e5975324c03874b82b62c6c2a4388321edb78e74 (diff) | |
| download | go-e26d743e2b600e448bee8f9cafd57ba4a70df813.tar.xz | |
cmd/link: print more information in TestExtLinkCmdlineDeterminism
Print more information in TestExtLinkCmdlineDeterminism to debug
test failure.
For #78180
Change-Id: I7e95eceb957805588c5dbb272370476d2378ea7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/758823
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/link/link_test.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cmd/link/link_test.go b/src/cmd/link/link_test.go index 32e7255bef..354442a2f9 100644 --- a/src/cmd/link/link_test.go +++ b/src/cmd/link/link_test.go @@ -1468,10 +1468,11 @@ func main() {} // Link with -v -linkmode=external to see the flags we pass to the // external linker. ldflags := "-ldflags=-v -linkmode=external -tmpdir=" + linktmp - var out0 []byte + var out0, fullOut0 []byte for i := 0; i < 5; i++ { - cmd := goCmd(t, "build", ldflags, "-o", exe, src) - out, err := cmd.CombinedOutput() + cmd := goCmd(t, "build", ldflags, "-x", "-o", exe, src) + fullOut, err := cmd.CombinedOutput() + out := fullOut if err != nil { t.Fatalf("build failed: %v, output:\n%s", err, out) } @@ -1504,10 +1505,12 @@ func main() {} if i == 0 { out0 = out + fullOut0 = fullOut continue } if !bytes.Equal(out0, out) { - t.Fatalf("output differ:\n%s\n==========\n%s", out0, out) + t.Fatalf("output differ:\n%s\n==========\n%s\n\nfull output:\n%s\n==========\n%s", + out0, out, fullOut0, fullOut) } } } |
