content: skip test if the 'go' command is missing
Change-Id: I52c906fc33b1e94c64419cbf574f15d67ce90e39
Reviewed-on: https://go-review.googlesource.com/c/tour/+/192328
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/content/content_test.go b/content/content_test.go
index 1052b7e..4c0ff2a 100644
--- a/content/content_test.go
+++ b/content/content_test.go
@@ -21,6 +21,10 @@
// Files that contain the string "// +build no-build" are not built.
// Files that contain the string "// +build no-run" are not executed.
func TestContent(t *testing.T) {
+ if _, err := exec.LookPath("go"); err != nil {
+ t.Skipf("skipping because 'go' executable not available: %v", err)
+ }
+
scratch, err := ioutil.TempDir("", "tour-content-test")
if err != nil {
t.Fatal(err)