exp/ebnflint: skip test if spec is not found
Fixes golang/go#38182.
Change-Id: I79dc349fe2352408f97824b2de30e213de37160f
Reviewed-on: https://go-review.googlesource.com/c/exp/+/226677
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
diff --git a/ebnflint/ebnflint_test.go b/ebnflint/ebnflint_test.go
index 875dbc1..91fb363 100644
--- a/ebnflint/ebnflint_test.go
+++ b/ebnflint/ebnflint_test.go
@@ -5,12 +5,18 @@
package main
import (
+ "os"
"runtime"
"testing"
)
func TestSpec(t *testing.T) {
if err := verify(runtime.GOROOT()+"/doc/go_spec.html", "SourceFile", nil); err != nil {
+ if os.IsNotExist(err) {
+ // Couldn't find/open the file - skip test rather than
+ // complain since not all builders copy the spec.
+ t.Skip("spec file not found")
+ }
t.Fatal(err)
}
}