aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime/debug
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-03-30 21:27:11 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-03-30 21:27:11 +0000
commit456fba2651cfb0cb67e44b8354668a0b3f5f5182 (patch)
tree9a0dfa827abe382ac0f44768e5365b87f00ac0a9 /libgo/go/runtime/debug
parente0be8a5c203451b47fd3da59b0e0f56cc3d42f22 (diff)
downloadgcc-456fba2651cfb0cb67e44b8354668a0b3f5f5182.zip
gcc-456fba2651cfb0cb67e44b8354668a0b3f5f5182.tar.gz
gcc-456fba2651cfb0cb67e44b8354668a0b3f5f5182.tar.bz2
libgo: Update to weekly.2012-03-13.
From-SVN: r186023
Diffstat (limited to 'libgo/go/runtime/debug')
-rw-r--r--libgo/go/runtime/debug/stack_test.go21
1 files changed, 14 insertions, 7 deletions
diff --git a/libgo/go/runtime/debug/stack_test.go b/libgo/go/runtime/debug/stack_test.go
index 94293bb..f33f507 100644
--- a/libgo/go/runtime/debug/stack_test.go
+++ b/libgo/go/runtime/debug/stack_test.go
@@ -39,13 +39,20 @@ func TestStack(t *testing.T) {
if len(lines) <= 6 {
t.Fatal("too few lines")
}
- check(t, lines[0], "src/pkg/runtime/debug/stack_test.go")
- check(t, lines[1], "\t(*T).ptrmethod: return Stack()")
- check(t, lines[2], "src/pkg/runtime/debug/stack_test.go")
- check(t, lines[3], "\tT.method: return t.ptrmethod()")
- check(t, lines[4], "src/pkg/runtime/debug/stack_test.go")
- check(t, lines[5], "\tTestStack: b := T(0).method()")
- check(t, lines[6], "src/pkg/testing/testing.go")
+ n := 0
+ frame := func(line, code string) {
+ check(t, lines[n], line)
+ n++
+ // The source might not be available while running the test.
+ if strings.HasPrefix(lines[n], "\t") {
+ check(t, lines[n], code)
+ n++
+ }
+ }
+ frame("src/pkg/runtime/debug/stack_test.go", "\t(*T).ptrmethod: return Stack()")
+ frame("src/pkg/runtime/debug/stack_test.go", "\tT.method: return t.ptrmethod()")
+ frame("src/pkg/runtime/debug/stack_test.go", "\tTestStack: b := T(0).method()")
+ frame("src/pkg/testing/testing.go", "")
}
func check(t *testing.T, line, has string) {