]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: add more logging to gc import test
authorDave Cheney <dave@cheney.net>
Thu, 3 Jan 2013 05:30:25 +0000 (16:30 +1100)
committerDave Cheney <dave@cheney.net>
Thu, 3 Jan 2013 05:30:25 +0000 (16:30 +1100)
* Extended deadline to 30 seconds
* Added logging of the duration of each package import
* Fail the test immediately if directories cannot be read

R=gri, minux.ma
CC=golang-dev
https://golang.org/cl/7030055

src/pkg/go/types/gcimporter_test.go

index d1cf605fe950dd29e25e2d5f7693d1358e5b6596..5f3236e0f3ed7d32139b7fd514bbac8fdc1e396c 100644 (file)
@@ -54,21 +54,23 @@ func compile(t *testing.T, dirname, filename string) string {
 var imports = make(map[string]*ast.Object)
 
 func testPath(t *testing.T, path string) bool {
+       t0 := time.Now()
        _, err := GcImport(imports, path)
        if err != nil {
                t.Errorf("testPath(%s): %s", path, err)
                return false
        }
+       t.Logf("testPath(%s): %v", path, time.Since(t0))
        return true
 }
 
-const maxTime = 3 * time.Second
+const maxTime = 30 * time.Second
 
 func testDir(t *testing.T, dir string, endTime time.Time) (nimports int) {
        dirname := filepath.Join(runtime.GOROOT(), "pkg", runtime.GOOS+"_"+runtime.GOARCH, dir)
        list, err := ioutil.ReadDir(dirname)
        if err != nil {
-               t.Errorf("testDir(%s): %s", dirname, err)
+               t.Fatalf("testDir(%s): %s", dirname, err)
        }
        for _, f := range list {
                if time.Now().After(endTime) {