Commit 865e5e98 authored by Shenghou Ma's avatar Shenghou Ma Committed by Minux Ma

runtime: fix TestCgoExternalThreadSIGPROF again

Shell out to `uname -r` this time, so that the test will compile
even if the platform doesn't have syscall.Sysctl.

Change-Id: I3a19ab5d820bdb94586a97f4507b3837d7040525
Reviewed-on: https://go-review.googlesource.com/2271Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 2cbe27a2
......@@ -7,9 +7,9 @@
package runtime_test
import (
"os/exec"
"runtime"
"strings"
"syscall"
"testing"
)
......@@ -59,12 +59,12 @@ func TestCgoExternalThreadSIGPROF(t *testing.T) {
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")
out, err := exec.Command("uname", "-r").Output()
if err != nil {
t.Fatalf("Sysctl(kern.osrelease) failed: %v", err)
t.Fatalf("uname -r failed: %v", err)
}
// OS X 10.6 == Darwin 10.x
if strings.HasPrefix(osver, "10.") {
if strings.HasPrefix(string(out), "10.") {
t.Skipf("no external linking on OS X 10.6")
}
}
......
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