Commit 2cbe27a2 authored by Shenghou Ma's avatar Shenghou Ma Committed by Minux Ma

runtime: skip TestCgoExternalThreadSIGPROF on OS X 10.6

The test program requires static constructor, which in turn needs
external linking to work, but external linking never works on 10.6.

This should fix the darwin-{386,amd64} builders.

Change-Id: I714fdd3e35f9a7e5f5659cf26367feec9412444f
Reviewed-on: https://go-review.googlesource.com/2235Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 0e05bd59
...@@ -9,6 +9,7 @@ package runtime_test ...@@ -9,6 +9,7 @@ package runtime_test
import ( import (
"runtime" "runtime"
"strings" "strings"
"syscall"
"testing" "testing"
) )
...@@ -52,8 +53,20 @@ func TestCgoExternalThreadPanic(t *testing.T) { ...@@ -52,8 +53,20 @@ func TestCgoExternalThreadPanic(t *testing.T) {
func TestCgoExternalThreadSIGPROF(t *testing.T) { func TestCgoExternalThreadSIGPROF(t *testing.T) {
// issue 9456. // issue 9456.
if runtime.GOOS == "plan9" || runtime.GOOS == "windows" { switch runtime.GOOS {
case "plan9", "windows":
t.Skipf("no pthreads on %s", runtime.GOOS) t.Skipf("no pthreads on %s", runtime.GOOS)
case "darwin":
// static constructor needs external linking, but we don't support
// external linking on OS X 10.6.
osver, err := syscall.Sysctl("kern.osrelease")
if err != nil {
t.Fatalf("Sysctl(kern.osrelease) failed: %v", err)
}
// OS X 10.6 == Darwin 10.x
if strings.HasPrefix(osver, "10.") {
t.Skipf("no external linking on OS X 10.6")
}
} }
got := executeTest(t, cgoExternalThreadSIGPROFSource, nil) got := executeTest(t, cgoExternalThreadSIGPROFSource, nil)
want := "OK\n" want := "OK\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment