2019-09-18 21:51:24 -06:00
|
|
|
// 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 gopls_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"golang.org/x/tools/go/packages/packagestest"
|
|
|
|
"golang.org/x/tools/gopls/internal/hooks"
|
|
|
|
cmdtest "golang.org/x/tools/internal/lsp/cmd/test"
|
2019-10-10 21:06:52 -06:00
|
|
|
"golang.org/x/tools/internal/lsp/source"
|
2019-09-18 21:51:24 -06:00
|
|
|
"golang.org/x/tools/internal/testenv"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestMain(m *testing.M) {
|
|
|
|
testenv.ExitIfSmallMachine()
|
|
|
|
os.Exit(m.Run())
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestCommandLine(t *testing.T) {
|
2020-04-27 10:12:05 -06:00
|
|
|
packagestest.TestAll(t,
|
|
|
|
cmdtest.TestCommandLine(
|
|
|
|
"../../internal/lsp/testdata",
|
|
|
|
commandLineOptions,
|
|
|
|
),
|
|
|
|
)
|
2019-09-18 21:51:24 -06:00
|
|
|
}
|
|
|
|
|
2019-10-10 21:06:52 -06:00
|
|
|
func commandLineOptions(options *source.Options) {
|
|
|
|
options.StaticCheck = true
|
|
|
|
options.GoDiff = false
|
|
|
|
hooks.Options(options)
|
|
|
|
}
|