diff --git a/internal/lsp/cmd/definition_test.go b/internal/lsp/cmd/definition_test.go index 8c2f530a..06fe6f9a 100644 --- a/internal/lsp/cmd/definition_test.go +++ b/internal/lsp/cmd/definition_test.go @@ -14,6 +14,7 @@ import ( "os/exec" "path/filepath" "regexp" + "runtime" "strconv" "strings" "testing" @@ -27,6 +28,9 @@ import ( var verifyGuru = flag.Bool("verify-guru", false, "Check that the guru compatability matches") func TestDefinitionHelpExample(t *testing.T) { + if runtime.GOOS == "android" { + t.Skip("not all source files are available on android") + } dir, err := os.Getwd() if err != nil { t.Errorf("could not get wd: %v", err) diff --git a/internal/lsp/lsp_test.go b/internal/lsp/lsp_test.go index f1df8222..3fe4bc94 100644 --- a/internal/lsp/lsp_test.go +++ b/internal/lsp/lsp_test.go @@ -13,6 +13,7 @@ import ( "go/token" "os/exec" "path/filepath" + "runtime" "strings" "testing" @@ -118,6 +119,14 @@ func testLSP(t *testing.T, exporter packagestest.Exporter) { }) t.Run("Format", func(t *testing.T) { + if _, err := exec.LookPath("gofmt"); err != nil { + switch runtime.GOOS { + case "android": + t.Skip("gofmt is not installed") + default: + t.Fatal(err) + } + } t.Helper() if goVersion111 { // TODO(rstambler): Remove this when we no longer support Go 1.10. if len(expectedFormat) != expectedFormatCount {