diff --git a/src/cmd/compile/internal/types2/check_test.go b/src/cmd/compile/internal/types2/check_test.go index 61bff28c8ee..0ee579062af 100644 --- a/src/cmd/compile/internal/types2/check_test.go +++ b/src/cmd/compile/internal/types2/check_test.go @@ -42,7 +42,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 TestManual") goVersion = flag.String("lang", "", "Go language version (e.g. \"go1.12\") for TestManual") ) @@ -239,15 +238,23 @@ func checkFiles(t *testing.T, filenames []string, goVersion string, colDelta uin } } -// 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() - checkFiles(t, strings.Split(*testFiles, ","), *goVersion, 0, testing.Verbose()) + checkFiles(t, filenames, *goVersion, 0, testing.Verbose()) } // TODO(gri) go/types has extra TestLongConstants and TestIndexRepresentability tests