diff options
Diffstat (limited to 'src/runtime/syscall_windows_test.go')
| -rw-r--r-- | src/runtime/syscall_windows_test.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/runtime/syscall_windows_test.go b/src/runtime/syscall_windows_test.go index 3da154dfa8..dfde12a211 100644 --- a/src/runtime/syscall_windows_test.go +++ b/src/runtime/syscall_windows_test.go @@ -15,6 +15,7 @@ import ( "os/exec" "path/filepath" "runtime" + "strconv" "strings" "syscall" "testing" @@ -537,6 +538,17 @@ func TestWERDialogue(t *testing.T) { cmd.CombinedOutput() } +func TestWindowsStackMemory(t *testing.T) { + 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 func use(buf []byte) { @@ -1043,7 +1055,7 @@ func BenchmarkRunningGoProgram(b *testing.B) { } exe := filepath.Join(tmpdir, "main.exe") - cmd := exec.Command("go", "build", "-o", exe, src) + cmd := exec.Command(testenv.GoToolPath(b), "build", "-o", exe, src) cmd.Dir = tmpdir out, err := cmd.CombinedOutput() if err != nil { |
