]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: run TestCgoSigfwd on all Unix platforms
authorAustin Clements <austin@google.com>
Fri, 14 Oct 2022 19:31:42 +0000 (15:31 -0400)
committerAustin Clements <austin@google.com>
Mon, 17 Oct 2022 15:15:36 +0000 (15:15 +0000)
This test was originally Linux-only, but there doesn't seem to be
anything Linux-specific in it.

Change-Id: I0f8519eff5dbed97f5e21e1c8e5ab0d747d51df3
Reviewed-on: https://go-review.googlesource.com/c/go/+/443073
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/internal/goos/nonunix.go [new file with mode: 0644]
src/internal/goos/unix.go [new file with mode: 0644]
src/runtime/crash_cgo_test.go
src/runtime/testdata/testprogcgo/sigfwd.go

diff --git a/src/internal/goos/nonunix.go b/src/internal/goos/nonunix.go
new file mode 100644 (file)
index 0000000..0f1373f
--- /dev/null
@@ -0,0 +1,5 @@
+//go:build !unix
+
+package goos
+
+const IsUnix = false
diff --git a/src/internal/goos/unix.go b/src/internal/goos/unix.go
new file mode 100644 (file)
index 0000000..6ef2a2c
--- /dev/null
@@ -0,0 +1,5 @@
+//go:build unix
+
+package goos
+
+const IsUnix = true
index 441a704ebeebd1198ba31c8b4762587ce1155f32..ba0e9f4ceda7c4b8a00860cf06c40ad7cace53cf 100644 (file)
@@ -757,8 +757,8 @@ func TestCgoTraceParserWithOneProc(t *testing.T) {
 
 func TestCgoSigfwd(t *testing.T) {
        t.Parallel()
-       if goos.IsLinux == 0 {
-               t.Skipf("only supported on Linux")
+       if !goos.IsUnix {
+               t.Skipf("no signals on %s", runtime.GOOS)
        }
 
        got := runTestProg(t, "testprogcgo", "CgoSigfwd", "GO_TEST_CGOSIGFWD=1")
index b27d436f82b90f956a87131d1ace91450eece8f5..b66616db36eb52bdc3a3cefa6b6fef02345480f5 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build linux
+//go:build unix
 
 package main