diff options
author | Jim Blandy <jimb@codesourcery.com> | 2001-10-02 19:42:10 +0000 |
---|---|---|
committer | Jim Blandy <jimb@codesourcery.com> | 2001-10-02 19:42:10 +0000 |
commit | 35a013977ba814543f2f1c1c993a089d4f05d4f6 (patch) | |
tree | 7e857d78edfc3aef01d18c6e8f7cf4761416e81f | |
parent | 0427d135c290db11be1c728dbc6b693335149118 (diff) | |
download | gdb-35a013977ba814543f2f1c1c993a089d4f05d4f6.tar.gz |
* lib/gdb.exp (test_xfail_format): Simplify.
* lib/gdb.exp (setup_xfail_format): Don't forget to put a `$' in
front of the variable name `format'. Simplify `if'.
-rw-r--r-- | gdb/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 26 |
2 files changed, 21 insertions, 12 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 67cadf4a7ae..59d888a0c7d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2001-10-02 Jim Blandy <jimb@redhat.com> + + * lib/gdb.exp (test_xfail_format): Simplify. + + * lib/gdb.exp (setup_xfail_format): Don't forget to put a `$' in + front of the variable name `format'. Simplify `if'. + 2001-10-01 Daniel Jacobowitz <drow@mvista.com> * gdb.threads/pthreads.exp: Wait for output and delay diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 6388877ee03..b36211ff559 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -1417,26 +1417,28 @@ proc get_debug_format { } { } } +# Return true if FORMAT matches the debug format the current test was +# compiled with. FORMAT is a shell-style globbing pattern; it can use +# `*', `[...]', and so on. +# +# This function depends on variables set by `get_debug_format', above. + +proc test_debug_format {format} { + global debug_format + + return [expr [string match $format $debug_format] != 0] +} + # Like setup_xfail, but takes the name of a debug format (DWARF 1, # COFF, stabs, etc). If that format matches the format that the # current test was compiled with, then the next test is expected to # fail for any target. Returns 1 if the next test or set of tests is # expected to fail, 0 otherwise (or if it is unknown). Must have # previously called get_debug_format. - -proc test_debug_format { format } { - global debug_format - - if [string match $debug_format $format] then { - return 1; - } - return 0 -} - proc setup_xfail_format { format } { - set ret [test_debug_format format]; + set ret [test_debug_format $format]; - if [expr $ret != 0] then { + if {$ret} then { setup_xfail "*-*-*" } return $ret; |