1
0
mirror of https://github.com/golang/go synced 2024-11-19 00:34:40 -07:00

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/2271
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Shenghou Ma 2015-01-03 00:12:34 -05:00 committed by Minux Ma
parent 2cbe27a272
commit 865e5e98b6

View File

@ -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")
}
}