Skip to content

Commit

Permalink
gopls/test: disable stderr output for command line tests as well
Browse files Browse the repository at this point in the history
Suppress output in gopls command line tests, similarly to CL 431843.

For golang/go#54845

Change-Id: I7f1e1de52c9a8fb0d902bfdd61bc99d4e2e308b9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/432955
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
  • Loading branch information
findleyr committed Sep 22, 2022
1 parent be3ff02 commit 62ae586
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gopls/test/gopls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ import (
"golang.org/x/tools/gopls/internal/lsp/source"
"golang.org/x/tools/gopls/internal/lsp/tests"
"golang.org/x/tools/internal/bug"
"golang.org/x/tools/internal/event"
"golang.org/x/tools/internal/testenv"
)

func TestMain(m *testing.M) {
bug.PanicOnBugs = true
testenv.ExitIfSmallMachine()

// Set the global exporter to nil so that we don't log to stderr. This avoids
// a lot of misleading noise in test output.
//
// See also ../internal/lsp/lsp_test.go.
event.SetExporter(nil)

os.Exit(m.Run())
}

Expand Down

0 comments on commit 62ae586

Please sign in to comment.