File: reset_golden.sh

package info (click to toggle)
golang-golang-x-tools 1%3A0.5.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports
  • size: 16,592 kB
  • sloc: javascript: 2,011; asm: 1,635; sh: 192; yacc: 155; makefile: 52; ansic: 8
file content (30 lines) | stat: -rwxr-xr-x 1,025 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
#
# Copyright 2022 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.
#
# Updates the *.golden files ... to match the tests' current behavior.

set -eu

GO117BIN="go1.17.9"

command -v $GO117BIN >/dev/null 2>&1 || {
  go install golang.org/dl/$GO117BIN@latest
  $GO117BIN download
}

find ./internal/lsp/testdata -name *.golden ! -name summary*.txt.golden -delete
# Here we intentionally do not run the ./internal/lsp/source tests with
# -golden. Eventually these tests will be deleted, and in the meantime they are
# redundant with the ./internal/lsp tests.
#
# Note: go1.17.9 tests must be run *before* go tests, as by convention the
# golden output should match the output of gopls built with the most recent
# version of Go. If output differs at 1.17, tests must be tolerant of the 1.17
# output.
$GO117BIN test ./internal/lsp -golden
go test ./internal/lsp -golden
$GO117BIN test ./test  -golden
go test ./test  -golden