diff options
author | Alex Brainman <alex.brainman@gmail.com> | 2017-11-14 12:51:58 +1100 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@golang.org> | 2017-11-14 03:53:15 +0000 |
commit | cea92e8d130540969056be58be188a8487d90a88 (patch) | |
tree | d97ac5227ceff1294996da2a826a6858ebcb8485 /src/runtime/crash_cgo_test.go | |
parent | b29bb78a7e0325a2522e14c25053c06a9a8ea1db (diff) | |
download | go-cea92e8d130540969056be58be188a8487d90a88.tar.gz go-cea92e8d130540969056be58be188a8487d90a88.zip |
runtime: make TestWindowsStackMemory build even with CGO_ENABLED=0 set
Just copy some code to make TestWindowsStackMemory build
when CGO_ENABLED is set to 0.
Fixes #22680
Change-Id: I63f9b409a3a97b7718f5d37837ab706d8ed92e81
Reviewed-on: https://go-review.googlesource.com/77430
Reviewed-by: Chris Hines <chris.cs.guy@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/crash_cgo_test.go')
-rw-r--r-- | src/runtime/crash_cgo_test.go | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/runtime/crash_cgo_test.go b/src/runtime/crash_cgo_test.go index a4f4dd606d..25ff34397f 100644 --- a/src/runtime/crash_cgo_test.go +++ b/src/runtime/crash_cgo_test.go @@ -454,7 +454,12 @@ func TestCgoLockOSThreadExit(t *testing.T) { testLockOSThreadExit(t, "testprogcgo") } -func testWindowsStackMemory(t *testing.T, o string) { +func TestWindowsStackMemoryCgo(t *testing.T) { + if runtime.GOOS != "windows" { + t.Skip("skipping windows specific test") + } + testenv.SkipFlaky(t, 22575) + o := runTestProg(t, "testprogcgo", "StackMemory") stackUsage, err := strconv.Atoi(o) if err != nil { t.Fatalf("Failed to read stack usage: %v", err) @@ -463,11 +468,3 @@ func testWindowsStackMemory(t *testing.T, o string) { t.Fatalf("expected < %d bytes of memory per thread, got %d", expected, got) } } - -func TestWindowsStackMemoryCgo(t *testing.T) { - if runtime.GOOS != "windows" { - t.Skip("skipping windows specific test") - } - testenv.SkipFlaky(t, 22575) - testWindowsStackMemory(t, runTestProg(t, "testprogcgo", "StackMemory")) -} |