]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: skip $GOROOT/src/*.go in TestStdlib
authorShenghou Ma <minux@golang.org>
Sat, 19 Sep 2015 10:59:06 +0000 (06:59 -0400)
committerMinux Ma <minux@golang.org>
Sun, 21 Feb 2016 22:39:44 +0000 (22:39 +0000)
Change-Id: I4a75d98a48675e2beb5b4843fb2c6ff5d4c8d2a2
Reviewed-on: https://go-review.googlesource.com/14769
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/stdlib_test.go

index 09f2585bcf8ab29951d85ebd28838e92e2f9aee3..97e6a69521ef82f83ce0ecfe3896d81b68fc5dbe 100644 (file)
@@ -266,13 +266,16 @@ func walkDirs(t *testing.T, dir string) {
        }
 
        // typecheck package in directory
-       files, err := pkgFilenames(dir)
-       if err != nil {
-               t.Error(err)
-               return
-       }
-       if files != nil {
-               typecheck(t, dir, files)
+       // but ignore files directly under $GOROOT/src (might be temporary test files).
+       if dir != filepath.Join(runtime.GOROOT(), "src") {
+               files, err := pkgFilenames(dir)
+               if err != nil {
+                       t.Error(err)
+                       return
+               }
+               if files != nil {
+                       typecheck(t, dir, files)
+               }
        }
 
        // traverse subdirectories, but don't walk into testdata