]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: simplify use of TestManual
authorRob Findley <rfindley@google.com>
Fri, 30 Apr 2021 18:55:11 +0000 (14:55 -0400)
committerRobert Findley <rfindley@google.com>
Sat, 1 May 2021 11:42:49 +0000 (11:42 +0000)
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>
src/go/types/check_test.go

index 0f2395238086e37ef91189bec5ce5d92523225a9..0bf9b7ae006d977a4a261363b593120376a8a703 100644 (file)
@@ -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) {