1
0
mirror of https://github.com/golang/go synced 2024-09-25 11:20:13 -06:00

cmd/dist: pass -tags race to go list in -race mode

so that runtime/race tests are included in the race builder.

Update #14011.

Change-Id: I04ac6e47366fdb1fe84ba89da556c6d38f7d4a47
Reviewed-on: https://go-review.googlesource.com/18686
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Shenghou Ma 2016-01-18 22:42:40 -05:00 committed by Minux Ma
parent 5395846890
commit 97266969d8

View File

@ -336,7 +336,11 @@ func (t *tester) registerTests() {
} else {
// Use a format string to only list packages and commands that have tests.
const format = "{{if (or .TestGoFiles .XTestGoFiles)}}{{.ImportPath}}{{end}}"
cmd := exec.Command("go", "list", "-f", format, "std")
cmd := exec.Command("go", "list", "-f", format)
if t.race {
cmd.Args = append(cmd.Args, "-tags", "race")
}
cmd.Args = append(cmd.Args, "std")
if !t.race {
cmd.Args = append(cmd.Args, "cmd")
}