]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use platform.RaceDetectorSupported for -race tests
authorIan Lance Taylor <iant@golang.org>
Fri, 21 Apr 2023 22:28:19 +0000 (15:28 -0700)
committerGopher Robot <gobot@golang.org>
Mon, 24 Apr 2023 05:06:55 +0000 (05:06 +0000)
Don't try to duplicate the list of targets that support -race.

Change-Id: I889d5c2f4884de89d88f8efdc89608aa73584a8a
Reviewed-on: https://go-review.googlesource.com/c/go/+/487575
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>

src/runtime/crash_cgo_test.go

index 1d8d874ca162aabd78749980537d535386785f51..5ed82d6eea614e3a00c9932dd81a35d2b0a804d5 100644 (file)
@@ -368,8 +368,8 @@ func TestCgoPprofThreadNoTraceback(t *testing.T) {
 }
 
 func TestRaceProf(t *testing.T) {
-       if (runtime.GOOS != "linux" && runtime.GOOS != "freebsd") || runtime.GOARCH != "amd64" {
-               t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH)
+       if !platform.RaceDetectorSupported(runtime.GOOS, runtime.GOARCH) {
+               t.Skipf("skipping on %s/%s because race detector not supported", runtime.GOOS, runtime.GOARCH)
        }
 
        testenv.MustHaveGoRun(t)
@@ -396,11 +396,12 @@ func TestRaceProf(t *testing.T) {
 }
 
 func TestRaceSignal(t *testing.T) {
-       t.Parallel()
-       if (runtime.GOOS != "linux" && runtime.GOOS != "freebsd") || runtime.GOARCH != "amd64" {
-               t.Skipf("not yet supported on %s/%s", runtime.GOOS, runtime.GOARCH)
+       if !platform.RaceDetectorSupported(runtime.GOOS, runtime.GOARCH) {
+               t.Skipf("skipping on %s/%s because race detector not supported", runtime.GOOS, runtime.GOARCH)
        }
 
+       t.Parallel()
+
        testenv.MustHaveGoRun(t)
 
        // This test requires building various packages with -race, so