From: David Lazar Date: Wed, 19 Apr 2017 16:04:18 +0000 (-0400) Subject: runtime: make test independent of inlining X-Git-Tag: go1.9beta1~586 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=da75700a641c7e2bd264dd873d637abfcbfffab1;p=gostls13.git runtime: make test independent of inlining TestBreakpoint expects to see "runtime.Breakpoint()" in the stack trace. If runtime.Breakpoint() is inlined, then the stack trace prints "runtime.Breakpoint(...)" since the runtime does not have information about arguments (or lack thereof) to inlined functions. This change makes the test independent of inlining by looking for the string "runtime.Breakpoint(". Now TestBreakpoint passes with -l=4. Change-Id: Ia044a8e8a4de2337cb2b393d6fa78c73a2f25926 Reviewed-on: https://go-review.googlesource.com/40997 Run-TryBot: David Lazar Reviewed-by: Austin Clements --- diff --git a/src/runtime/crash_test.go b/src/runtime/crash_test.go index 3f84935f4e..f6a0cd6cbb 100644 --- a/src/runtime/crash_test.go +++ b/src/runtime/crash_test.go @@ -308,7 +308,9 @@ func TestNoHelperGoroutines(t *testing.T) { func TestBreakpoint(t *testing.T) { output := runTestProg(t, "testprog", "Breakpoint") - want := "runtime.Breakpoint()" + // If runtime.Breakpoint() is inlined, then the stack trace prints + // "runtime.Breakpoint(...)" instead of "runtime.Breakpoint()". + want := "runtime.Breakpoint(" if !strings.Contains(output, want) { t.Fatalf("output:\n%s\n\nwant output containing: %s", output, want) }