aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/dist/test.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2023-05-17 15:10:51 -0400
committerAustin Clements <austin@google.com>2023-05-19 01:37:34 +0000
commit408f7a4663fdb19357e2c0967eb442a1e5679b2d (patch)
tree09ea43d5062e467f8a0d3e13d66314e27fa8d2cf /src/cmd/dist/test.go
parent18ffa7185d42427dbdc0144956fece6c2b54b27a (diff)
downloadgo-408f7a4663fdb19357e2c0967eb442a1e5679b2d.tar.gz
go-408f7a4663fdb19357e2c0967eb442a1e5679b2d.zip
cmd/dist: don't pass -linkmode=auto
This is the default value of this flag, so passing it clutters up debugging output. This also makes it clearer which tests are running with a default configuration. Change-Id: If793934829c79f087c7a6e3fa8f64dc33959c213 Reviewed-on: https://go-review.googlesource.com/c/go/+/496176 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/cmd/dist/test.go')
-rw-r--r--src/cmd/dist/test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index 132542cde1..fe818036b5 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -1096,7 +1096,11 @@ func (t *tester) registerCgoTests(heading string) {
variant: variant,
pkg: "cmd/cgo/internal/" + subdir,
buildmode: buildmode,
- ldflags: "-linkmode=" + linkmode,
+ }
+ var ldflags []string
+ if linkmode != "auto" {
+ // "auto" is the default, so avoid cluttering the command line for "auto"
+ ldflags = append(ldflags, "-linkmode="+linkmode)
}
if linkmode == "internal" {
@@ -1110,7 +1114,7 @@ func (t *tester) registerCgoTests(heading string) {
// cgoTest we want static linking.
gt.buildmode = ""
if linkmode == "external" {
- gt.ldflags += ` -extldflags "-static -pthread"`
+ ldflags = append(ldflags, `-extldflags "-static -pthread"`)
} else if linkmode == "auto" {
gt.env = append(gt.env, "CGO_LDFLAGS=-static -pthread")
} else {
@@ -1118,6 +1122,7 @@ func (t *tester) registerCgoTests(heading string) {
}
gt.tags = append(gt.tags, "static")
}
+ gt.ldflags = strings.Join(ldflags, " ")
t.registerTest("cgo:"+subdir+":"+variant, heading, gt, opts...)
return gt