From a3ffb8a1ac0edc57fff7dd8d79e3ff9129ed6708 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 12 Nov 2019 14:55:42 -0500 Subject: 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 Reviewed-by: Jay Conrod TryBot-Result: Gobot Gobot --- src/cmd/go/script_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/cmd/go/script_test.go') 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) } -- cgit v1.2.1