aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/dist
diff options
context:
space:
mode:
authorfanzha02 <fannie.zhang@arm.com>2021-03-01 10:34:08 +0800
committerfannie zhang <Fannie.Zhang@arm.com>2021-03-11 05:38:13 +0000
commit3a3b8164fdcb071955284c13cda6ee0f29fc8bd3 (patch)
tree066f7ce567243f700495812f1d39b3fb7f2d53d3 /src/cmd/dist
parent68f3344fe95dde95685b0d7fbbf74d13f3e9ee04 (diff)
downloadgo-3a3b8164fdcb071955284c13cda6ee0f29fc8bd3.tar.gz
go-3a3b8164fdcb071955284c13cda6ee0f29fc8bd3.zip
cmd/dist: refactor test constraints for misc/cgo/testsantizers
Currently, the cmd/dist runs test cases in misc/cgo/testsantizers only when memeory sanitizer is supported, but the tsan tests in misc/cgo/testsanitizers do not require support for -msan option, which makes tsan tests can not be run on some unsupported -msan option platforms. Therefore, this patch moves the test constraints from cmd/dist to msan_test.go, so that the tsan tests in misc/cgo/testsanitizers can be run on any system where the C compiler supports -fsanitize=thread option. Change-Id: I779c92eedd0270050f1a0b1a69ecce50c3712bc9 Reviewed-on: https://go-review.googlesource.com/c/go/+/297774 Trust: fannie zhang <Fannie.Zhang@arm.com> Run-TryBot: fannie zhang <Fannie.Zhang@arm.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/dist')
-rw-r--r--src/cmd/dist/test.go16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go
index 0c8e2c56bc..cbf3ec6d88 100644
--- a/src/cmd/dist/test.go
+++ b/src/cmd/dist/test.go
@@ -736,8 +736,9 @@ func (t *tester) registerTests() {
if gohostos == "linux" && goarch == "amd64" {
t.registerTest("testasan", "../misc/cgo/testasan", "go", "run", ".")
}
- if mSanSupported(goos, goarch) {
- t.registerHostTest("testsanitizers/msan", "../misc/cgo/testsanitizers", "misc/cgo/testsanitizers", ".")
+ if goos == "linux" {
+ // because syscall.SysProcAttri struct used in misc/cgo/testsanitizers is only built on linux.
+ t.registerHostTest("testsanitizers", "../misc/cgo/testsanitizers", "misc/cgo/testsanitizers", ".")
}
if t.hasBash() && goos != "android" && !t.iOS() && gohostos != "windows" {
t.registerHostTest("cgo_errors", "../misc/cgo/errors", "misc/cgo/errors", ".")
@@ -1640,17 +1641,6 @@ func raceDetectorSupported(goos, goarch string) bool {
}
}
-// mSanSupported is a copy of the function cmd/internal/sys.MSanSupported,
-// which can't be used here because cmd/dist has to be buildable by Go 1.4.
-func mSanSupported(goos, goarch string) bool {
- switch goos {
- case "linux":
- return goarch == "amd64" || goarch == "arm64"
- default:
- return false
- }
-}
-
// isUnsupportedVMASize reports whether the failure is caused by an unsupported
// VMA for the race detector (for example, running the race detector on an
// arm64 machine configured with 39-bit VMA)