summaryrefslogtreecommitdiff
path: root/libgo/go/cmd/go/internal/test/genflags.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/cmd/go/internal/test/genflags.go')
-rw-r--r--libgo/go/cmd/go/internal/test/genflags.go24
1 files changed, 20 insertions, 4 deletions
diff --git a/libgo/go/cmd/go/internal/test/genflags.go b/libgo/go/cmd/go/internal/test/genflags.go
index 9277de7fee8..10f290090c7 100644
--- a/libgo/go/cmd/go/internal/test/genflags.go
+++ b/libgo/go/cmd/go/internal/test/genflags.go
@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build ignore
-// +build ignore
package main
@@ -16,6 +15,8 @@ import (
"strings"
"testing"
"text/template"
+
+ "cmd/go/internal/test/internal/genflags"
)
func main() {
@@ -25,9 +26,18 @@ func main() {
}
func regenerate() error {
+ vetAnalyzers, err := genflags.VetAnalyzers()
+ if err != nil {
+ return err
+ }
+
t := template.Must(template.New("fileTemplate").Parse(fileTemplate))
+ tData := map[string][]string{
+ "testFlags": testFlags(),
+ "vetAnalyzers": vetAnalyzers,
+ }
buf := bytes.NewBuffer(nil)
- if err := t.Execute(buf, testFlags()); err != nil {
+ if err := t.Execute(buf, tData); err != nil {
return err
}
@@ -64,7 +74,7 @@ func testFlags() []string {
name := strings.TrimPrefix(f.Name, "test.")
switch name {
- case "testlogfile", "paniconexit0":
+ case "testlogfile", "paniconexit0", "fuzzcachedir", "fuzzworker":
// These flags are only for use by cmd/go.
default:
names = append(names, name)
@@ -85,7 +95,13 @@ package test
// passFlagToTest contains the flags that should be forwarded to
// the test binary with the prefix "test.".
var passFlagToTest = map[string]bool {
-{{- range .}}
+{{- range .testFlags}}
+ "{{.}}": true,
+{{- end }}
+}
+
+var passAnalyzersToVet = map[string]bool {
+{{- range .vetAnalyzers}}
"{{.}}": true,
{{- end }}
}