summaryrefslogtreecommitdiff
path: root/src/cmd/go/script_test.go
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2019-11-12 14:55:42 -0500
committerBryan C. Mills <bcmills@google.com>2019-11-12 20:54:41 +0000
commita3ffb8a1ac0edc57fff7dd8d79e3ff9129ed6708 (patch)
tree24c1a3c6f5d5629227a52a19c9f6a12f7aaae1ce /src/cmd/go/script_test.go
parent4d0ed149ffc94af16156307f08418b65ca084185 (diff)
downloadgo-git-a3ffb8a1ac0edc57fff7dd8d79e3ff9129ed6708.tar.gz
cmd/go: convert TestCacheVet to a script
This test was failing when GOROOT was read-only. (I'm not sure why that was the case, but it's simpler to convert to to a script than to try to debug the non-script test.) Updates #28387 Change-Id: I9943e28d990e5d8b01da10e70531f3ab99e319a7 Reviewed-on: https://go-review.googlesource.com/c/go/+/206897 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/go/script_test.go')
-rw-r--r--src/cmd/go/script_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go
index 942fca85a8..fbe4698ee5 100644
--- a/src/cmd/go/script_test.go
+++ b/src/cmd/go/script_test.go
@@ -292,6 +292,17 @@ Script:
}).(bool)
break
}
+ if strings.HasPrefix(cond.tag, "GODEBUG:") {
+ value := strings.TrimPrefix(cond.tag, "GODEBUG:")
+ parts := strings.Split(os.Getenv("GODEBUG"), ",")
+ for _, p := range parts {
+ if strings.TrimSpace(p) == value {
+ ok = true
+ break
+ }
+ }
+ break
+ }
if !imports.KnownArch[cond.tag] && !imports.KnownOS[cond.tag] && cond.tag != "gc" && cond.tag != "gccgo" {
ts.fatalf("unknown condition %q", cond.tag)
}