]> Cypherpunks repositories - gostls13.git/commitdiff
testenv: allow HasGoBuild to be false on -noopt builders
authorBryan C. Mills <bcmills@google.com>
Thu, 4 May 2023 21:14:53 +0000 (17:14 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 4 May 2023 21:30:44 +0000 (21:30 +0000)
-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 <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>

src/internal/testenv/testenv_test.go

index be766288e8874c6fb9a164040d2f73c1cfc469cb..d748e41540a4adfbdc94b3e1d1b331b3baec414c 100644 (file)
@@ -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)
        }