aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/dist/test.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2023-05-12 15:19:23 -0400
committerGopher Robot <gobot@golang.org>2023-05-12 19:43:56 +0000
commit57009d45040e92124fb4aefd59825d3525fd7d3a (patch)
treec1a1ca840655b7de37e2e4632002bbbbd8b212ff /src/cmd/dist/test.go
parentf2fcea5009d06d14b9869879f897c4ffb11cf953 (diff)
downloadgo-57009d45040e92124fb4aefd59825d3525fd7d3a.tar.gz
go-57009d45040e92124fb4aefd59825d3525fd7d3a.zip
cmd/cgo/internal/testsanitizers: build on all platforms
This test package uses the Pdeathsig field of syscall.SysProcAttr, which is only available on a few platforms. Currently, dist test checks for compatible platforms and only registers it as part of all.bash on platforms where it can build. But this doesn't help if you're just trying to type check everything in cmd. Make this package pass type checking by moving the condition from dist into build tags on the test package itself. For #60164. Updates #37486. Change-Id: I58b12d547c323cec895320baa5fca1b82e99d1b5 Reviewed-on: https://go-review.googlesource.com/c/go/+/494658 Auto-Submit: Austin Clements <austin@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Austin Clements <austin@google.com>
Diffstat (limited to 'src/cmd/dist/test.go')
-rw-r--r--src/cmd/dist/test.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index 8cd8abc19e..1d8125c51d 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -832,11 +832,7 @@ func (t *tester) registerTests() {
if t.supportedBuildmode("plugin") {
t.registerTest("cgo_testplugin", "", &goTest{pkg: "cmd/cgo/internal/testplugin", timeout: 600 * time.Second})
}
- if goos == "linux" || (goos == "freebsd" && goarch == "amd64") {
- // because Pdeathsig of syscall.SysProcAttr struct used in cmd/cgo/internal/testsanitizers is only
- // supported on Linux and FreeBSD.
- t.registerTest("cgo_testsanitizers", "", &goTest{pkg: "cmd/cgo/internal/testsanitizers", timeout: 5 * time.Minute})
- }
+ t.registerTest("cgo_testsanitizers", "", &goTest{pkg: "cmd/cgo/internal/testsanitizers", timeout: 5 * time.Minute})
if t.hasBash() && goos != "android" && !t.iOS() && gohostos != "windows" {
t.registerTest("cgo_errors", "", &goTest{pkg: "cmd/cgo/internal/testerrors", timeout: 5 * time.Minute})
}