diff --git a/gopls/internal/lsp/cmd/cmd_test.go b/gopls/internal/lsp/cmd/cmd_test.go deleted file mode 100644 index 877ceb66eb..0000000000 --- a/gopls/internal/lsp/cmd/cmd_test.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cmd_test - -import ( - "os" - "testing" - - "golang.org/x/tools/internal/bug" - cmdtest "golang.org/x/tools/gopls/internal/lsp/cmd/test" - "golang.org/x/tools/gopls/internal/lsp/tests" - "golang.org/x/tools/internal/testenv" -) - -func TestMain(m *testing.M) { - bug.PanicOnBugs = true - testenv.ExitIfSmallMachine() - os.Exit(m.Run()) -} - -func TestCommandLine(t *testing.T) { - cmdtest.TestCommandLine(t, "../testdata", tests.DefaultOptions) -} diff --git a/gopls/internal/lsp/cmd/test/cmdtest.go b/gopls/internal/lsp/cmd/test/cmdtest.go index 86608c7c95..e2a3e546e2 100644 --- a/gopls/internal/lsp/cmd/test/cmdtest.go +++ b/gopls/internal/lsp/cmd/test/cmdtest.go @@ -12,10 +12,10 @@ import ( "fmt" "io" "os" + "runtime" "sync" "testing" - "golang.org/x/tools/internal/jsonrpc2/servertest" "golang.org/x/tools/gopls/internal/lsp/cache" "golang.org/x/tools/gopls/internal/lsp/cmd" "golang.org/x/tools/gopls/internal/lsp/debug" @@ -23,6 +23,7 @@ import ( "golang.org/x/tools/gopls/internal/lsp/protocol" "golang.org/x/tools/gopls/internal/lsp/source" "golang.org/x/tools/gopls/internal/lsp/tests" + "golang.org/x/tools/internal/jsonrpc2/servertest" "golang.org/x/tools/internal/span" "golang.org/x/tools/internal/tool" ) @@ -37,8 +38,8 @@ type runner struct { func TestCommandLine(t *testing.T, testdata string, options func(*source.Options)) { // On Android, the testdata directory is not copied to the runner. - if stat, err := os.Stat(testdata); err != nil || !stat.IsDir() { - t.Skip("testdata directory not present") + if runtime.GOOS == "android" { + t.Skip("testdata directory not present on android") } tests.RunTests(t, testdata, false, func(t *testing.T, datum *tests.Data) { ctx := tests.Context(t) diff --git a/gopls/test/gopls_test.go b/gopls/test/gopls_test.go index 4f266baaa1..248a03b789 100644 --- a/gopls/test/gopls_test.go +++ b/gopls/test/gopls_test.go @@ -23,7 +23,7 @@ func TestMain(m *testing.M) { } func TestCommandLine(t *testing.T) { - cmdtest.TestCommandLine(t, "../../internal/lsp/testdata", commandLineOptions) + cmdtest.TestCommandLine(t, "../internal/lsp/testdata", commandLineOptions) } func commandLineOptions(options *source.Options) {