From e335a2665f5e322a7da8baa22fe816b6ef9aaf24 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 4 May 2023 17:14:53 -0400 Subject: [PATCH] testenv: allow HasGoBuild to be false on -noopt builders -noopt uses GO_GCFLAGS to disable optimization, and GO_GCFLAGS has caused HasGoBuild to be false since CL 74470. Change-Id: Iadcd15d412c05aec11e9a23b86d7b24af79d73bf Reviewed-on: https://go-review.googlesource.com/c/go/+/492795 TryBot-Result: Gopher Robot Reviewed-by: Austin Clements Run-TryBot: Bryan Mills Auto-Submit: Bryan Mills --- src/internal/testenv/testenv_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/internal/testenv/testenv_test.go b/src/internal/testenv/testenv_test.go index be766288e8..d748e41540 100644 --- a/src/internal/testenv/testenv_test.go +++ b/src/internal/testenv/testenv_test.go @@ -96,6 +96,14 @@ func TestHasGoBuild(t *testing.T) { return } } + + if strings.HasSuffix(b, "-noopt") { + // The -noopt builder sets GO_GCFLAGS, which causes tests of 'go build' to + // be skipped. + t.Logf("HasGoBuild is false on %s", b) + return + } + t.Fatalf("HasGoBuild unexpectedly false on %s", b) } -- 2.50.0