From: Andrew Gerrand Date: Thu, 28 May 2015 22:14:58 +0000 (-0700) Subject: cmd/dist: only test packages and commands that have tests X-Git-Tag: go1.5beta1~446 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4c050fea0e17d5c66369e3cf254c30380c0ec6fe;p=gostls13.git cmd/dist: only test packages and commands that have tests Change-Id: I7aeb9fef3739c17c03fdaadbe00cd945ec9c0d72 Reviewed-on: https://go-review.googlesource.com/10492 Run-TryBot: Andrew Gerrand Reviewed-by: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index f5a0dc50f1..2c80aa6181 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -395,7 +395,9 @@ func (t *tester) registerTests() { // of running `go list std cmd` if we're running a specific test. // Now we know the names of all the other tests registered so far. if !t.wantSpecificRegisteredTest() { - all, err := exec.Command("go", "list", "std", "cmd").Output() + // Use a format string to only list packages and commands that have tests. + const format = "{{if (or .TestGoFiles .XTestGoFiles)}}{{.ImportPath}}{{end}}" + all, err := exec.Command("go", "list", "-f", format, "std", "cmd").Output() if err != nil { log.Fatalf("Error running go list std cmd: %v", err) }