From 798e0b38ed8b23da010b1a8cd6c91f201248e40d Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 16 May 2019 10:00:10 -0400 Subject: misc/cgo/errors: consolidate test work Build a single binary containing all the TestPointerChecks instead of building many small binaries, each with its own cgo+compile+link invocation. This cuts 'go test -run=TestPointerChecks' from 6.7r 35.5u 26.1s to 2.1r 2.1u 1.4s. Move as many cgo checks as possible into fewer test files for TestReportsTypeErrors too. This cuts 'go test -run=TestReportsTypeErrors' from 2.1r 6.7u 6.7s to 1.5r 2.5u 2.5s. After this change, all.bash runs in ~4:30 on my laptop. For #26473. Change-Id: I3787448b03689a1f62dd810957ab6013bb75582f Reviewed-on: https://go-review.googlesource.com/c/go/+/177599 Run-TryBot: Russ Cox TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- misc/cgo/errors/errors_test.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'misc/cgo/errors/errors_test.go') diff --git a/misc/cgo/errors/errors_test.go b/misc/cgo/errors/errors_test.go index f727158c48..e6bac0fff4 100644 --- a/misc/cgo/errors/errors_test.go +++ b/misc/cgo/errors/errors_test.go @@ -63,7 +63,7 @@ func expect(t *testing.T, file string, errors []*regexp.Regexp) { defer os.RemoveAll(dir) dst := filepath.Join(dir, strings.TrimSuffix(file, ".go")) - cmd := exec.Command("go", "build", "-gcflags=-L", "-o="+dst, path(file)) // TODO(gri) no need for -gcflags=-L if go tool is adjusted + cmd := exec.Command("go", "build", "-gcflags=-L -e", "-o="+dst, path(file)) // TODO(gri) no need for -gcflags=-L if go tool is adjusted out, err := cmd.CombinedOutput() if err == nil { t.Errorf("expected cgo to fail but it succeeded") @@ -107,21 +107,10 @@ func TestReportsTypeErrors(t *testing.T) { for _, file := range []string{ "err1.go", "err2.go", - "err3.go", - "issue7757.go", - "issue8442.go", "issue11097a.go", "issue11097b.go", - "issue13129.go", - "issue13423.go", - "issue13467.go", - "issue13635.go", - "issue13830.go", - "issue16116.go", - "issue16591.go", "issue18452.go", "issue18889.go", - "issue26745.go", "issue28721.go", } { check(t, file) -- cgit v1.3-5-g9baa