cmd/compile/internal/types2: nest all test data under the testdata directory

This matches https://golang.org/cl/314829 for go/types.

Change-Id: If3d127af0557bb13d504581920ea03e39db0eb07
Reviewed-on: https://go-review.googlesource.com/c/go/+/314772
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Robert Griesemer 2021-04-28 15:08:47 -07:00
parent 12eaefead4
commit 948a262455
106 changed files with 6 additions and 5 deletions

View File

@ -42,8 +42,8 @@ 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")
goVersion = flag.String("lang", "", "Go language version (e.g. \"go1.12\"")
testFiles = flag.String("files", "", "comma-separated list of TestManual")
goVersion = flag.String("lang", "", "Go language version (e.g. \"go1.12\") for TestManual")
)
func parseFiles(t *testing.T, filenames []string, mode syntax.Mode) ([]*syntax.File, []error) {
@ -239,9 +239,9 @@ func checkFiles(t *testing.T, filenames []string, goVersion string, colDelta uin
}
}
// TestCheck is for manual testing of selected input files, provided with -files.
// TestManual is for manual testing of selected input files, provided with -files.
// The accepted Go language version can be controlled with the -lang flag.
func TestCheck(t *testing.T) {
func TestManual(t *testing.T) {
if *testFiles == "" {
return
}
@ -252,13 +252,14 @@ func TestCheck(t *testing.T) {
// TODO(gri) go/types has extra TestLongConstants and TestIndexRepresentability tests
func TestTestdata(t *testing.T) { DefPredeclaredTestFuncs(); testDir(t, "testdata", 75) } // TODO(gri) narrow column tolerance
func TestCheck(t *testing.T) { DefPredeclaredTestFuncs(); testDir(t, "check", 75) } // TODO(gri) narrow column tolerance
func TestExamples(t *testing.T) { testDir(t, "examples", 0) }
func TestFixedbugs(t *testing.T) { testDir(t, "fixedbugs", 0) }
func testDir(t *testing.T, dir string, colDelta uint) {
testenv.MustHaveGoBuild(t)
dir = filepath.Join("testdata", dir)
fis, err := os.ReadDir(dir)
if err != nil {
t.Error(err)

Some files were not shown because too many files have changed in this diff Show More