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)
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"))
-}
"os/exec"
"path/filepath"
"runtime"
+ "strconv"
"strings"
"syscall"
"testing"
}
func TestWindowsStackMemory(t *testing.T) {
- testWindowsStackMemory(t, runTestProg(t, "testprog", "StackMemory"))
+ o := runTestProg(t, "testprog", "StackMemory")
+ stackUsage, err := strconv.Atoi(o)
+ if err != nil {
+ t.Fatalf("Failed to read stack usage: %v", err)
+ }
+ if expected, got := 100<<10, stackUsage; got > expected {
+ t.Fatalf("expected < %d bytes of memory per thread, got %d", expected, got)
+ }
}
var used byte