This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: [RFA] srcwin testing patch
- To: "Martin M. Hunt" <hunt at redhat dot com>
- Subject: Re: [RFA] srcwin testing patch
- From: Fernando Nasser <fnasser at redhat dot com>
- Date: Thu, 05 Apr 2001 10:05:22 -0400
- CC: insight at sources dot redhat dot com
- Organization: Red Hat Canada
- References: <Pine.SUN.4.33.0104050008050.24122-100000@rtl.cygnus.com>
Finally someone find some time to look into the testsuite.
Thanks Martin.
I agree with the line numbers fix, of course. To prevent this from
happen again, I think we should copy the files list0.c and list1.c files
from gdb.base to gdb.gdbtk.
W.r.t. the "up when at the top" removal I think we must find a better
solution than to remove it. This is a valid test condition. CAn we
relax the test a bit so it will still check for major breakage and yet
accommodate the different results?
Regards,
Fernando
"Martin M. Hunt" wrote:
>
> make check "RUNTESTFLAGS=srcwin.exp"
>
> Before:
> # of expected passes 70
> # of unexpected failures 30
>
> with patch:
> # of expected passes 96
> # of unexpected failures 1
>
> I eliminated three test cases that tested trying to move up the stack past
> main() because the behavior can vary. The 1 remaining failure is a valid
> gdb bug. Most of this patch is simply changing the hardcoded line numbers
> that have been failing since someone changed the test programs in
> gdb.base.
>
> 2001-04-05 Martin M. Hunt <hunt@redhat.com>
>
> * srcwin1.test: Fix line numbers to correspond to
> modified source files in gdb.base. Removed test case for
> moving up past main() because sometimes there is a
> libc init function.
> * srcwin2.test: Ditto.
> * srcwin3.test: Ditto.
>
> Index: testsuite/gdb.gdbtk/srcwin.test
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.gdbtk/srcwin.test,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 srcwin.test
> --- srcwin.test 2000/02/07 00:19:45 1.1.1.1
> +++ srcwin.test 2001/04/05 07:07:26
> @@ -1,4 +1,4 @@
> -# Copyright (C) 1999 Cygnus Solutions
> +# Copyright (C) 1999, 2001 Red Hat, Inc.
> #
> # This program is free software; you can redistribute it and/or modify
> # it under the terms of the GNU General Public License as published by
> @@ -296,7 +296,7 @@ gdbtk_test srcwin-2.6 "goto function bar
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "BROWSE_TAG"} {
> - if {$i == "5.2"} {
> + if {$i == "10.2"} {
> incr r
> } else {
> incr r 5
> @@ -340,9 +340,9 @@ gdbtk_test srcwin-2.7 "goto function oof
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "BROWSE_TAG"} {
> - if {$i == "32.2"} {
> + if {$i == "38.2"} {
> set line_number [$twin get "$i wordstart" "$i wordend"]
> - if {$line_number == "32"} {
> + if {$line_number == "38"} {
> incr r
> } else {
> incr r -100
> @@ -475,7 +475,7 @@ gdbtk_test srcwin-2.10 "step" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "8.2"} {
> + if {$i == "9.2"} {
> incr r
> } else {
> incr r 5
> @@ -519,7 +519,7 @@ gdbtk_test srcwin-2.11 "set BP and conti
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "32.2"} {
> + if {$i == "38.2"} {
> incr r
> } else {
> incr r 5
> @@ -565,14 +565,16 @@ gdbtk_test srcwin-3.1 "stack up (1)" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "32.2"} {
> + # return n + 1;
> + if {$i == "38.2"} {
> incr r
> } else {
> incr r 5
> }
> }
> if {$v == "STACK_TAG"} {
> - if {$i == "22.2"} {
> + # oof (67);
> + if {$i == "26.2"} {
> incr r
> } else {
> incr r 10
> @@ -611,14 +613,16 @@ gdbtk_test srcwin-3.2 "stack up (2)" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "32.2"} {
> + # return n + 1;
> + if {$i == "38.2"} {
> incr r
> } else {
> incr r 5
> }
> }
> if {$v == "STACK_TAG"} {
> - if {$i == "7.2"} {
> + # long_line ();
> + if {$i == "12.2"} {
> incr r
> } else {
> incr r 10
> @@ -657,7 +661,7 @@ gdbtk_test srcwin-3.3 "stack up (3)" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "STACK_TAG"} {
> - if {$i == "8.2"} {
> + if {$i == "9.2"} {
> incr r
> } else {
> incr r 5
> @@ -715,48 +719,8 @@ gdbtk_test srcwin-3.4 "stack up (4)" {
> } {1}
>
> # Test: srcwin-3.5
> -# Desc: "stack up" when we are at the top
> -gdbtk_test srcwin-3.5 "stack up when at the top" {
> - $srcwin stack up
> - set r 0
> - set name [$statbar.name get]
> - set func [$statbar.func get]
> -
> - # check contents of name and function comboboxes
> - if {$name != "list0.c"} {set r -1}
> - if {$func != "main"} {set r -2}
> -
> - # check that the correct file is displayed
> - set twin [$stw test_get twin]
> - set a [$twin get 1.0 end]
> - if {[string compare $file1(source) $a]} {set r -3}
> -
> - # check for PC_TAG and STACK_TAG on correct lines
> - if {$r == 0} {
> - if {![catch {set z [$twin dump -tag 1.0 end]}]} {
> - foreach {k v i} $z {
> - if {$k == "tagon"} {
> - if {$v == "STACK_TAG"} {
> - if {$i == "12.2"} {
> - incr r
> - } else {
> - incr r 5
> - }
> - }
> - if {$v == "PC_TAG"} {incr r 10}
> - if {$v == "BROWSE_TAG"} {incr r 100}
> - }
> - }
> - } else {
> - set r -4
> - }
> - }
> - set r
> -} {1}
> -
> -# Test: srcwin-3.6
> # Desc: "stack down" test
> -gdbtk_test srcwin-3.6 "stack down" {
> +gdbtk_test srcwin-3.5 "stack down" {
> $srcwin stack down
> set r 0
> set name [$statbar.name get]
> @@ -777,7 +741,7 @@ gdbtk_test srcwin-3.6 "stack down" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "STACK_TAG"} {
> - if {$i == "8.2"} {
> + if {$i == "9.2"} {
> incr r
> } else {
> incr r 5
> @@ -794,9 +758,9 @@ gdbtk_test srcwin-3.6 "stack down" {
> set r
> } {1}
>
> -# Test: srcwin-3.7
> +# Test: srcwin-3.6
> # Desc: "stack bottom" test
> -gdbtk_test srcwin-3.7 "stack bottom" {
> +gdbtk_test srcwin-3.6 "stack bottom" {
> $srcwin stack bottom
> set r 0
> set name [$statbar.name get]
> @@ -817,7 +781,7 @@ gdbtk_test srcwin-3.7 "stack bottom" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "32.2"} {
> + if {$i == "38.2"} {
> incr r
> } else {
> incr r 5
> @@ -834,9 +798,9 @@ gdbtk_test srcwin-3.7 "stack bottom" {
> set r
> } {1}
>
> -# Test: srcwin-3.8
> +# Test: srcwin-3.7
> # Desc: "stack down" when at bottom
> -gdbtk_test srcwin-3.8 "stack down when at bottom" {
> +gdbtk_test srcwin-3.7 "stack down when at bottom" {
> $srcwin stack down
> set r 0
> set name [$statbar.name get]
> @@ -857,7 +821,7 @@ gdbtk_test srcwin-3.8 "stack down when a
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "32.2"} {
> + if {$i == "38.2"} {
> incr r
> } else {
> incr r 5
> @@ -897,7 +861,7 @@ gdbtk_test srcwin-4.1 "set BP in another
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "BROWSE_TAG"} {
> - if {$i == "8.2"} {
> + if {$i == "9.2"} {
> incr r
> } else {
> incr r 5
> @@ -906,7 +870,7 @@ gdbtk_test srcwin-4.1 "set BP in another
> if {$v == "STACK_TAG"} {incr r 10}
> if {$v == "PC_TAG"} {incr r 100}
> } elseif {$k == "image"} {
> - if {$i == "8.0"} {
> + if {$i == "9.0"} {
> incr r
> } else {
> set r -200
> @@ -950,7 +914,7 @@ gdbtk_test srcwin-4.2 "temporary BP" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "BROWSE_TAG"} {
> - if {$i == "8.2"} {
> + if {$i == "9.2"} {
> incr r
> } else {
> incr r 5
> @@ -959,7 +923,7 @@ gdbtk_test srcwin-4.2 "temporary BP" {
> if {$v == "STACK_TAG"} {incr r 10}
> if {$v == "PC_TAG"} {incr r 100}
> } elseif {$k == "image"} {
> - if {$i == "8.0"} {
> + if {$i == "9.0"} {
> incr r
> } else {
> set r -200
> @@ -979,7 +943,7 @@ gdbtk_test srcwin-4.2 "temporary BP" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "8.2"} {
> + if {$i == "9.2"} {
> incr r
> } else {
> incr r 5
> @@ -1016,7 +980,7 @@ gdbtk_test srcwin-4.3 "BP Balloons" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "8.2"} {
> + if {$i == "9.2"} {
> incr r
> } else {
> incr r 5
> @@ -1176,9 +1140,9 @@ gdbtk_test srcwin-5.1 "variable balloon
> move_mouse_to $twin [$twin bbox 10.$index]
> sleep 1
> if {[winfo ismapped $balloon]} {
> - if {![string compare "x=6" [$balloon.label cget -text]]} {incr r}
> + if {![string compare "x=5" [$balloon.label cget -text]]} {incr r}
> gdb_immediate "continue" 1
> - if {![string compare "x=8" [$balloon.label cget -text]]} {incr r}
> + if {![string compare "x=7" [$balloon.label cget -text]]} {incr r}
> } else {
> set r -1
> }
> Index: testsuite/gdb.gdbtk/srcwin2.test
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.gdbtk/srcwin2.test,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 srcwin2.test
> --- srcwin2.test 2000/02/07 00:19:45 1.1.1.1
> +++ srcwin2.test 2001/04/05 07:07:26
> @@ -1,4 +1,4 @@
> -# Copyright (C) 1999 Cygnus Solutions
> +# Copyright (C) 1999, 2001 Red Hat, Inc.
> #
> # This program is free software; you can redistribute it and/or modify
> # it under the terms of the GNU General Public License as published by
> @@ -283,14 +283,14 @@ gdbtk_test srcwin2-2.6 "goto function ba
> # now get a dump of all tags and check that only one line is
> # marked BROWSE_TAG and no lines are STACK_TAG or PC_TAG.
>
> - # We know that list1.c should have BROWSE_TAG set at index 5.2
> + # We know that list1.c should have BROWSE_TAG set at index 10.2
> # for function "bar". If list1.c is changed or the layout of the source
> # window is changed, this must be updated.
> if {![catch {set z [$twin dump -tag 1.0 end]}]} {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "BROWSE_TAG"} {
> - if {$i == "5.2"} {
> + if {$i == "10.2"} {
> incr r
> } else {
> incr r 5
> @@ -327,16 +327,16 @@ gdbtk_test srcwin2-2.7 "goto function oo
> # now get a dump of all tags and check that only one line is
> # marked BROWSE_TAG and no lines are STACK_TAG or PC_TAG.
>
> - # We know that list1.c should have BROWSE_TAG set at index 32.2
> + # We know that list1.c should have BROWSE_TAG set at index 38.2
> # for function "oof". If list1.c is changed or the layout of the source
> # window is changed, this must be updated.
> if {![catch {set z [$twin dump -tag 1.0 end]}]} {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "BROWSE_TAG"} {
> - if {$i == "32.2"} {
> + if {$i == "38.2"} {
> set line_number [$twin get "$i wordstart" "$i wordend"]
> - if {$line_number == "32"} {
> + if {$line_number == "38"} {
> incr r
> } else {
> incr r -100
> @@ -426,7 +426,7 @@ gdbtk_test srcwin2-2.11 "set BP and cont
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "32.2"} {
> + if {$i == "38.2"} {
> incr r
> } else {
> incr r 5
> @@ -472,14 +472,14 @@ gdbtk_test srcwin2-3.1 "stack up (1)" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "32.2"} {
> + if {$i == "38.2"} {
> incr r
> } else {
> incr r 5
> }
> }
> if {$v == "STACK_TAG"} {
> - if {$i == "22.2"} {
> + if {$i == "26.2"} {
> incr r
> } else {
> incr r 10
> @@ -518,14 +518,14 @@ gdbtk_test srcwin2-3.2 "stack up (2)" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "32.2"} {
> + if {$i == "38.2"} {
> incr r
> } else {
> incr r 5
> }
> }
> if {$v == "STACK_TAG"} {
> - if {$i == "7.2"} {
> + if {$i == "12.2"} {
> incr r
> } else {
> incr r 10
> @@ -564,7 +564,7 @@ gdbtk_test srcwin2-3.3 "stack up (3)" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "STACK_TAG"} {
> - if {$i == "8.2"} {
> + if {$i == "9.2"} {
> incr r
> } else {
> incr r 5
> @@ -617,45 +617,10 @@ gdbtk_test srcwin2-3.4 "stack up (4)" {
> set r
> } {1}
>
> -# Test: srcwin2-3.5
> -# Desc: "stack up" when we are at the top
> -gdbtk_test srcwin2-3.5 "stack up when at the top" {
> - $srcwin stack up
> - set r 0
> - set name [$statbar.name get]
> - set func [$statbar.func get]
> -
> - # check contents of name and function comboboxes
> - if {$name != "list0.c"} {set r -1}
> - if {$func != "main"} {set r -2}
> -
> - # check that the correct file is displayed
> - set twin [$stw test_get twin]
> - set a [$twin get 1.0 end]
> - if {[string compare $file1(source) $a]} {set r -3}
> -
> - # check for STACK_TAG
> - if {$r == 0} {
> - if {![catch {set z [$twin dump -tag 1.0 end]}]} {
> - foreach {k v i} $z {
> - if {$k == "tagon"} {
> - if {$v == "STACK_TAG"} {
> - incr r
> - }
> - if {$v == "PC_TAG"} {incr r 10}
> - if {$v == "BROWSE_TAG"} {incr r 100}
> - }
> - }
> - } else {
> - set r -4
> - }
> - }
> - set r
> -} {1}
>
> -# Test: srcwin2-3.6
> +# Test: srcwin2-3.5
> # Desc: "stack down" test
> -gdbtk_test srcwin2-3.6 "stack down" {
> +gdbtk_test srcwin2-3.5 "stack down" {
> $srcwin stack down
> set r 0
> set name [$statbar.name get]
> @@ -676,7 +641,7 @@ gdbtk_test srcwin2-3.6 "stack down" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "STACK_TAG"} {
> - if {$i == "8.2"} {
> + if {$i == "9.2"} {
> incr r
> } else {
> incr r 5
> @@ -693,9 +658,9 @@ gdbtk_test srcwin2-3.6 "stack down" {
> set r
> } {1}
>
> -# Test: srcwin2-3.7
> +# Test: srcwin2-3.6
> # Desc: "stack bottom" test
> -gdbtk_test srcwin2-3.7 "stack bottom" {
> +gdbtk_test srcwin2-3.6 "stack bottom" {
> $srcwin stack bottom
> set r 0
> set name [$statbar.name get]
> @@ -716,7 +681,7 @@ gdbtk_test srcwin2-3.7 "stack bottom" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "32.2"} {
> + if {$i == "38.2"} {
> incr r
> } else {
> incr r 5
> @@ -733,9 +698,9 @@ gdbtk_test srcwin2-3.7 "stack bottom" {
> set r
> } {1}
>
> -# Test: srcwin2-3.8
> +# Test: srcwin2-3.7
> # Desc: "stack down" when at bottom
> -gdbtk_test srcwin2-3.8 "stack down when at bottom" {
> +gdbtk_test srcwin2-3.7 "stack down when at bottom" {
> $srcwin stack down
> set r 0
> set name [$statbar.name get]
> @@ -756,7 +721,7 @@ gdbtk_test srcwin2-3.8 "stack down when
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "32.2"} {
> + if {$i == "38.2"} {
> incr r
> } else {
> incr r 5
> @@ -796,7 +761,7 @@ gdbtk_test srcwin2-4.1 "set BP in anothe
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "BROWSE_TAG"} {
> - if {$i == "8.2"} {
> + if {$i == "9.2"} {
> incr r
> } else {
> incr r 5
> @@ -805,7 +770,7 @@ gdbtk_test srcwin2-4.1 "set BP in anothe
> if {$v == "STACK_TAG"} {incr r 10}
> if {$v == "PC_TAG"} {incr r 100}
> } elseif {$k == "image"} {
> - if {$i == "8.0"} {
> + if {$i == "9.0"} {
> incr r
> } else {
> set r -200
> @@ -849,7 +814,7 @@ gdbtk_test srcwin2-4.2 "temporary BP" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "BROWSE_TAG"} {
> - if {$i == "8.2"} {
> + if {$i == "9.2"} {
> incr r
> } else {
> incr r 5
> @@ -858,7 +823,7 @@ gdbtk_test srcwin2-4.2 "temporary BP" {
> if {$v == "STACK_TAG"} {incr r 10}
> if {$v == "PC_TAG"} {incr r 100}
> } elseif {$k == "image"} {
> - if {$i == "8.0"} {
> + if {$i == "9.0"} {
> incr r
> } else {
> set r -200
> @@ -878,7 +843,7 @@ gdbtk_test srcwin2-4.2 "temporary BP" {
> foreach {k v i} $z {
> if {$k == "tagon"} {
> if {$v == "PC_TAG"} {
> - if {$i == "8.2"} {
> + if {$i == "9.2"} {
> incr r
> } else {
> incr r 5
> Index: testsuite/gdb.gdbtk/srcwin3.test
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.gdbtk/srcwin3.test,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 srcwin3.test
> --- srcwin3.test 2000/02/07 00:19:45 1.1.1.1
> +++ srcwin3.test 2001/04/05 07:07:26
> @@ -1,4 +1,4 @@
> -# Copyright (C) 1999 Cygnus Solutions
> +# Copyright (C) 1999, 2001 Red Hat, Inc.
> #
> # This program is free software; you can redistribute it and/or modify
> # it under the terms of the GNU General Public License as published by
> @@ -542,44 +542,8 @@ gdbtk_test srcwin3-3.4 "stack up (4)" {
> } {1}
>
> # Test: srcwin3-3.5
> -# Desc: "stack up" when we are at the top
> -gdbtk_test srcwin3-3.5 "stack up when at the top" {
> - $srcwin stack up
> - set r 0
> - set name [$statbar.name get]
> - set func [$statbar.func get]
> -
> - # check contents of name and function comboboxes
> - if {$name != ""} {set r -1}
> - if {$func != "main"} {set r -2}
> -
> - # check that the correct file is displayed
> - set twin [$stw test_get twin]
> - set a [$twin get 1.0 end]
> - if {[string compare $source(main) $a]} {set r -3}
> -
> - # check for STACK_TAG
> - if {$r == 0} {
> - if {![catch {set z [$twin dump -tag 1.0 end]}]} {
> - foreach {k v i} $z {
> - if {$k == "tagon"} {
> - if {$v == "STACK_TAG"} {
> - incr r
> - }
> - if {$v == "PC_TAG"} {incr r 10}
> - if {$v == "BROWSE_TAG"} {incr r 100}
> - }
> - }
> - } else {
> - set r -4
> - }
> - }
> - set r
> -} {1}
> -
> -# Test: srcwin3-3.6
> # Desc: "stack down" test
> -gdbtk_test srcwin3-3.6 "stack down" {
> +gdbtk_test srcwin3-3.5 "stack down" {
> $srcwin stack down
> set r 0
> set name [$statbar.name get]
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9