This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Test result of "up" command in testsuites.


Michael Snyder wrote:
> 
> There are several tests in the testsuite that perform an "up" command
> and then blythely assume that it succeeded (by evaluating variables
> in the callers scope etc.).  I've added a FAIL msg if the "up" command
> fails, so at least we will know why the subsequent tests failed.

Thanks Michael.  But please add a "pass" as well to the cases where it
applies before you check it in.  

You just hit a lucky spot and found one of those cases that can
have a FAIL without having a corresponding PASS and thus confusing the
test comparison scripts (the you tell you that things disappeared :-)

Regards,
Fernando


> 
> 2000-12-05  Michael Snyder  <msnyder@mvstp600e.cygnus.com>
> 
>         * gdb.base/constvars.exp: Test result of "up" command.
>         * gdb.base/miscexprs.exp: Ditto.
>         * gdb.base/pointers.exp:  Ditto.
>         * gdb.base/scope.exp:     Ditto.
>         * gdb.c++/derivation.exp: Ditto.
>         * gdb.c++/local.exp:      Ditto.
>         * gdb.c++/namespace.exp:  Ditto.
>         * gdb.c++/overload.exp:   Ditto.
>         * gdb.c++/ref-types.exp:  Ditto.
> 
> Index: gdb.base/constvars.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/constvars.exp,v
> retrieving revision 1.1.1.2
> diff -c -3 -p -r1.1.1.2 constvars.exp
> *** constvars.exp       1999/06/28 16:03:00     1.1.1.2
> --- constvars.exp       2000/12/05 23:10:33
> *************** send_gdb "break marker1\n" ; gdb_expect
> *** 79,94 ****
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*$gdb_prompt $" {}
> !                 timeout { fail "up from marker1" }
>               }
>           }
>           -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
>             fail "continue to marker1 (demangling)"
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*$gdb_prompt $" {}
> !                 timeout { fail "up from marker1" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> --- 79,100 ----
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !               -re ".*main.*$gdb_prompt $" {}
> !                 -re ".*$gdb_prompt $" {
> !                   fail "up from marker1"
> !               }
> !                 timeout { fail "up from marker1 (timeout)" }
>               }
>           }
>           -re "Break.* marker1__.* \\(\\) at .*:$decimal.*$gdb_prompt $" {
>             fail "continue to marker1 (demangling)"
>               send_gdb "up\n"
>               gdb_expect {
> !               -re ".*main.*$gdb_prompt $" {}
> !                 -re ".*$gdb_prompt $" {
> !                   fail "up from marker1"
> !               }
> !                 timeout { fail "up from marker1 (timeout)" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> Index: gdb.base/miscexprs.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/miscexprs.exp,v
> retrieving revision 1.2
> diff -c -3 -p -r1.2 miscexprs.exp
> *** miscexprs.exp       2000/04/24 21:32:51     1.2
> --- miscexprs.exp       2000/12/05 23:10:33
> *************** send_gdb "break marker1\n" ; gdb_expect
> *** 69,76 ****
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*$gdb_prompt $" {}
> !                 timeout { fail "up from marker1" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> --- 69,79 ----
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !               -re ".*main.*$gdb_prompt $" {}
> !                 -re ".*$gdb_prompt $" {
> !                   fail "up from marker1"
> !               }
> !                 timeout { fail "up from marker1 (timeout)" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> Index: gdb.base/pointers.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/pointers.exp,v
> retrieving revision 1.1.1.4
> diff -c -3 -p -r1.1.1.4 pointers.exp
> *** pointers.exp        1999/08/02 23:46:51     1.1.1.4
> --- pointers.exp        2000/12/05 23:10:33
> *************** send_gdb "break marker1\n" ; gdb_expect
> *** 371,378 ****
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*$gdb_prompt $" {}
> !                 timeout { fail "up from marker1" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> --- 371,381 ----
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*more_code.*$gdb_prompt $" {}
> !                 -re ".*$gdb_prompt $" {
> !                   fail "up from marker1"
> !               }
> !                 timeout { fail "up from marker1 (timeout)" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> Index: gdb.base/scope.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.base/scope.exp,v
> retrieving revision 1.1.1.3
> diff -c -3 -p -r1.1.1.3 scope.exp
> *** scope.exp   1999/08/02 23:46:51     1.1.1.3
> --- scope.exp   2000/12/05 23:10:33
> *************** proc test_at_autovars {} {
> *** 452,458 ****
>         gdb_suppress_tests;
>       }
> 
> !     if [gdb_test "up" ".*" "" ] {
>         gdb_suppress_tests ;
>       }
> 
> --- 452,458 ----
>         gdb_suppress_tests;
>       }
> 
> !     if [gdb_test "up" ".*autovars.*" "up from marker1 in scope.exp" ] {
>         gdb_suppress_tests ;
>       }
> 
> *************** proc test_at_localscopes {} {
> *** 484,490 ****
>       if [gdb_test "cont" "Break.* marker2 \\(\\) at .*:$decimal.*" "continue to marker2"] {
>         gdb_suppress_tests;
>       }
> !     if [gdb_test "up" ".*" "" ] {
>         gdb_suppress_tests ;
>       }
> 
> --- 484,490 ----
>       if [gdb_test "cont" "Break.* marker2 \\(\\) at .*:$decimal.*" "continue to marker2"] {
>         gdb_suppress_tests;
>       }
> !     if [gdb_test "up" ".*localscopes.*" "up from marker2 in scopes.exp" ] {
>         gdb_suppress_tests ;
>       }
> 
> *************** proc test_at_localscopes {} {
> *** 499,505 ****
> 
>       if [gdb_test "cont" "Break.* marker3 \\(\\) at .*:$decimal.*" \
>         "continue to marker3 in scope.exp"] then { gdb_suppress_tests }
> !     if [gdb_test "up" "" "up from marker3 in scope.exp"] then { gdb_suppress_tests }
> 
>       # Should be at next (first nested) scope.  Check values.
> 
> --- 499,507 ----
> 
>       if [gdb_test "cont" "Break.* marker3 \\(\\) at .*:$decimal.*" \
>         "continue to marker3 in scope.exp"] then { gdb_suppress_tests }
> !     if [gdb_test "up" ".*localscopes.*" "up from marker3 in scope.exp"] {
> !       gdb_suppress_tests
> !     }
> 
>       # Should be at next (first nested) scope.  Check values.
> 
> *************** proc test_at_localscopes {} {
> *** 515,521 ****
>       setup_xfail "a29k-*-udi" 2423
>       if [gdb_test "cont" "Break.* marker4.*at .*:$decimal.*" \
>         "continue to marker4 in scope.exp"] then { gdb_suppress_tests }
> !     if [gdb_test "up" "" "up from marker4 in scope.exp"] then { gdb_suppress_tests }
> 
>       gdb_test "print localval" " = 30" "print localval, innermost scope"
>       gdb_test "print localval1" " = 11" "print localval1, innermost scope"
> --- 517,525 ----
>       setup_xfail "a29k-*-udi" 2423
>       if [gdb_test "cont" "Break.* marker4.*at .*:$decimal.*" \
>         "continue to marker4 in scope.exp"] then { gdb_suppress_tests }
> !     if [gdb_test "up" ".*localscopes.*" "up from marker4 in scope.exp"] {
> !       gdb_suppress_tests
> !     }
> 
>       gdb_test "print localval" " = 30" "print localval, innermost scope"
>       gdb_test "print localval1" " = 11" "print localval1, innermost scope"
> Index: gdb.c++/derivation.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/derivation.exp,v
> retrieving revision 1.1.1.8
> diff -c -3 -p -r1.1.1.8 derivation.exp
> *** derivation.exp      1999/12/07 03:56:17     1.1.1.8
> --- derivation.exp      2000/12/05 23:10:33
> *************** send_gdb "break marker1\n" ; gdb_expect
> *** 76,83 ****
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*$gdb_prompt $" {}
> !                 timeout { fail "up from marker1" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> --- 76,86 ----
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*main.*$gdb_prompt $" {}
> !                 -re ".*$gdb_prompt $" {
> !                   fail "up from marker1"
> !               }
> !                 timeout { fail "up from marker1 (timeout)" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> Index: gdb.c++/local.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/local.exp,v
> retrieving revision 1.2
> diff -c -3 -p -r1.2 local.exp
> *** local.exp   2000/06/06 20:17:13     1.2
> --- local.exp   2000/12/05 23:10:33
> *************** send_gdb "break marker1\n" ; gdb_expect
> *** 68,75 ****
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*$gdb_prompt $" {}
> !                 timeout { fail "up from marker1" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> --- 68,78 ----
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*main.*$gdb_prompt $" {}
> !                 -re ".*$gdb_prompt $" {
> !                   fail "up from marker1"
> !               }
> !                 timeout { fail "up from marker1 (timeout)" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> Index: gdb.c++/namespace.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/namespace.exp,v
> retrieving revision 1.1
> diff -c -3 -p -r1.1 namespace.exp
> *** namespace.exp       2000/06/05 20:47:28     1.1
> --- namespace.exp       2000/12/05 23:10:33
> *************** send_gdb "break marker1\n" ; gdb_expect
> *** 73,80 ****
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*$gdb_prompt $" { pass "up from marker1" }
> !                 timeout { fail "up from marker1" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> --- 73,81 ----
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*main.*$gdb_prompt $" { pass "up from marker1" }
> !                 -re ".*$gdb_prompt $" { fail "up from marker1" }
> !                 timeout { fail "up from marker1 (timeout)" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> Index: gdb.c++/overload.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/overload.exp,v
> retrieving revision 1.1.1.5
> diff -c -3 -p -r1.1.1.5 overload.exp
> *** overload.exp        1999/09/22 03:26:23     1.1.1.5
> --- overload.exp        2000/12/05 23:10:33
> *************** send_gdb "break marker1\n" ; gdb_expect
> *** 68,75 ****
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*$gdb_prompt $" {}
> !                 timeout { fail "up from marker1" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> --- 68,78 ----
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*main.*$gdb_prompt $" {}
> !                 -re ".*$gdb_prompt $" {
> !                   fail "up from marker1"
> !               }
> !                 timeout { fail "up from marker1 (timeout)" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> Index: gdb.c++/ref-types.exp
> ===================================================================
> RCS file: /cvs/src/src/gdb/testsuite/gdb.c++/ref-types.exp,v
> retrieving revision 1.1.1.4
> diff -c -3 -p -r1.1.1.4 ref-types.exp
> *** ref-types.exp       1999/09/09 00:00:29     1.1.1.4
> --- ref-types.exp       2000/12/05 23:10:33
> *************** send_gdb "break marker1\n" ; gdb_expect
> *** 61,68 ****
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*$gdb_prompt $" {}
> !                 timeout { fail "up from marker1" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }
> --- 61,71 ----
>           -re "Break.* marker1 \\(\\) at .*:$decimal.*$gdb_prompt $" {
>               send_gdb "up\n"
>               gdb_expect {
> !                 -re ".*main.*$gdb_prompt $" {}
> !                 -re ".*$gdb_prompt $" {
> !                   fail "up from marker1"
> !               }
> !                 timeout { fail "up from marker1 (timeout)" }
>               }
>           }
>           -re "$gdb_prompt $" { fail "continue to marker1"  }

-- 
Fernando Nasser
Red Hat - Toronto                       E-Mail:  fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario   M4P 2C9

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]