From a8df5de46d31194dfe6d67299ecaae8b33943b10 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 25 Mar 2009 19:25:49 +0000 Subject: * gdb.base/charset.exp (valid_target_charset): New proc. Use it to skip tests on invalid charsets. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.base/charset.exp | 12 ++++++++++++ 2 files changed, 17 insertions(+) (limited to 'gdb/testsuite') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 7f7f6f6..6d94121 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-03-25 Tom Tromey + + * gdb.base/charset.exp (valid_target_charset): New proc. + Use it to skip tests on invalid charsets. + 2009-03-25 Pierre Muller * gdb.base/completion.exp: Add a test for directory completion. diff --git a/gdb/testsuite/gdb.base/charset.exp b/gdb/testsuite/gdb.base/charset.exp index a6368c9..1ce275d 100644 --- a/gdb/testsuite/gdb.base/charset.exp +++ b/gdb/testsuite/gdb.base/charset.exp @@ -131,6 +131,11 @@ proc valid_host_charset {charset} { return [expr {[info exists charsets($charset)] && $charsets($charset)}] } +proc valid_target_charset {charset} { + global charsets + return [info exists charsets($charset)] +} + send_gdb "set host-charset\n" gdb_expect { -re "Requires an argument. Valid arguments are (\[^ \t\n\r,.\]*)" { @@ -238,6 +243,9 @@ foreach host_charset $charset_subset { # Now try setting every possible target character set, # given that host charset. foreach target_charset $charset_subset { + if {![valid_target_charset $target_charset]} { + continue + } set testname "try `set target-charset $target_charset'" send_gdb "set target-charset $target_charset\n" gdb_expect { @@ -376,6 +384,10 @@ if {$wchar_size == 2} { gdb_test "set host-charset ASCII" "" foreach target_charset $charset_subset { + if {![valid_target_charset $target_charset]} { + continue + } + if {$target_charset == "UCS-4" || $target_charset == "UCS-2"} { set param target-wide-charset set L L -- cgit v1.1