aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/cgo/internal/testshared
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2025-09-11 23:48:04 +0000
committerMichael Knyszek <mknyszek@google.com>2025-09-15 14:21:33 -0700
commit004858ccddb2f092d3413e96ba8526a8df8e3906 (patch)
tree4dd8105c7243cd66c3850ba405b4747995088b65 /src/cmd/cgo/internal/testshared
parentdbde15800c97e425f4ad1b47c1ee0c302f963fb5 (diff)
downloadgo-004858ccddb2f092d3413e96ba8526a8df8e3906.tar.xz
all: replace os.Getenv("GO_BUILDER_NAME") with testenv.Builder in tests
Some tests still reach for GO_BUILDER_NAME directly. This change makes it so that they go through testenv.Builder. There are a couple more, but changing them may also cause tests to start failing. Done in a follow-up. Change-Id: Id2453b7b62f5ebf3594e92fa53724a577a97440f Reviewed-on: https://go-review.googlesource.com/c/go/+/703135 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/cgo/internal/testshared')
-rw-r--r--src/cmd/cgo/internal/testshared/shared_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/cgo/internal/testshared/shared_test.go b/src/cmd/cgo/internal/testshared/shared_test.go
index e927460376..3d401b604e 100644
--- a/src/cmd/cgo/internal/testshared/shared_test.go
+++ b/src/cmd/cgo/internal/testshared/shared_test.go
@@ -96,7 +96,7 @@ func goCmd(t *testing.T, args ...string) string {
// TestMain calls testMain so that the latter can use defer (TestMain exits with os.Exit).
func testMain(m *testing.M) (int, error) {
- if testing.Short() && os.Getenv("GO_BUILDER_NAME") == "" {
+ if testing.Short() && testenv.Builder() == "" {
globalSkip = func(t testing.TB) { t.Skip("short mode and $GO_BUILDER_NAME not set") }
return m.Run(), nil
}
@@ -554,7 +554,7 @@ func checkPIE(t *testing.T, name string) {
}
func TestTrivialPIE(t *testing.T) {
- if strings.HasSuffix(os.Getenv("GO_BUILDER_NAME"), "-alpine") {
+ if strings.Contains(testenv.Builder(), "-alpine") {
t.Skip("skipping on alpine until issue #54354 resolved")
}
globalSkip(t)