]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: provide updating mechanism for format test
authorRobert Griesemer <gri@golang.org>
Tue, 13 Nov 2018 23:33:57 +0000 (15:33 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 16 Nov 2018 17:33:54 +0000 (17:33 +0000)
commit69010963aa233b7b2762762595ae230692b1c724
tree628ee471bb9ada81e31b26961c540736d915211c
parent8d335084cc58c8167b12ce5d1791bfc6db1355f2
cmd/compile: provide updating mechanism for format test

The compiler's Format test verifies that the correct format
strings for the given arguments are used in the compiler
sources. The format strings are fairly specialized which is
why we cannot use go vet; and the mapping is based on a
hard-wired map.

In the past, if that map got out of sync with the compiler
sources, it was necessary to manually update the map. This
change introduces an update mechanism which simply requires
the test to be run with the -u flag.

(Formerly, the -u flag was used to automatically rewrite
format strings; now we use -r for that.)

Change-Id: I9259566a6120a13cf34b143875975ada62697890
Reviewed-on: https://go-review.googlesource.com/c/149460
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/cmd/compile/fmt_test.go
src/cmd/compile/fmtmap_test.go [new file with mode: 0644]