From: Bryan C. Mills Date: Thu, 4 May 2023 21:14:53 +0000 (-0400) Subject: testenv: allow HasGoBuild to be false on -noopt builders X-Git-Tag: go1.21rc1~672 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e335a2665f5e322a7da8baa22fe816b6ef9aaf24;p=gostls13.git 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 --- 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) }