From: Dave Cheney Date: Thu, 3 Jan 2013 05:30:25 +0000 (+1100) Subject: go/types: add more logging to gc import test X-Git-Tag: go1.1rc2~1489 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=14b654369dcf62505ad9bf8650cbd19d95e1f026;p=gostls13.git go/types: add more logging to gc import test * 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 --- diff --git a/src/pkg/go/types/gcimporter_test.go b/src/pkg/go/types/gcimporter_test.go index d1cf605fe9..5f3236e0f3 100644 --- a/src/pkg/go/types/gcimporter_test.go +++ b/src/pkg/go/types/gcimporter_test.go @@ -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) {