aboutsummaryrefslogtreecommitdiff
path: root/src/go
diff options
context:
space:
mode:
authorRob Findley <rfindley@google.com>2021-04-30 14:55:11 -0400
committerRobert Findley <rfindley@google.com>2021-05-01 11:42:49 +0000
commita9db5a73867f676f2f6a1b8fd2bb61d06b0a10f7 (patch)
tree37ed10b96ac6809f39383167f6aa08fe59097355 /src/go
parentffc38d8ab47753643687a99c66cecd8e044b5c70 (diff)
downloadgo-a9db5a73867f676f2f6a1b8fd2bb61d06b0a10f7.tar.gz
go-a9db5a73867f676f2f6a1b8fd2bb61d06b0a10f7.zip
go/types: simplify use of TestManual
This is a 1:1 port of CL 315689 to go/types. Change-Id: If71186b3719be8433c9d21b22c51ffde2cadd55b Reviewed-on: https://go-review.googlesource.com/c/go/+/315849 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/go')
-rw-r--r--src/go/types/check_test.go16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/go/types/check_test.go b/src/go/types/check_test.go
index 0f23952380..0bf9b7ae00 100644
--- a/src/go/types/check_test.go
+++ b/src/go/types/check_test.go
@@ -47,7 +47,6 @@ import (
var (
haltOnError = flag.Bool("halt", false, "halt on error")
listErrors = flag.Bool("errlist", false, "list errors")
- testFiles = flag.String("files", "", "comma-separated list of test files for TestManual")
goVersion = flag.String("lang", "", "Go language version (e.g. \"go1.12\") for TestManual")
)
@@ -297,16 +296,23 @@ func checkFiles(t *testing.T, sizes Sizes, goVersion string, filenames []string,
}
}
-// TestManual is for manual testing of selected input files, provided with
-// -files.
+// TestManual is for manual testing of input files, provided as a list
+// of arguments after the test arguments (and a separating "--"). For
+// instance, to check the files foo.go and bar.go, use:
+//
+// go test -run Manual -- foo.go bar.go
+//
+// To get an error list rather than having the test check against
+// ERROR comments in the input files, provide the -errlist flag.
// The accepted Go language version can be controlled with the -lang flag.
func TestManual(t *testing.T) {
- if *testFiles == "" {
+ filenames := flag.Args()
+ if len(filenames) == 0 {
return
}
testenv.MustHaveGoBuild(t)
DefPredeclaredTestFuncs()
- testPkg(t, strings.Split(*testFiles, ","), *goVersion)
+ testPkg(t, filenames, *goVersion)
}
func TestLongConstants(t *testing.T) {