public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed 1/4] [gdb/testsuite] Fix false negative in have_host_locale
@ 2023-08-29 15:27 Tom de Vries
  2023-08-29 15:27 ` [pushed 2/4] [gdb/testsuite] Handle some test-cases with older compiler Tom de Vries
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tom de Vries @ 2023-08-29 15:27 UTC (permalink / raw)
  To: gdb-patches

In test-case gdb.tui/pr30056.exp we check for:
...
require {have_host_locale C.UTF-8}
...

The "C.UTF-8" is normalized by have_host_locale to "c.utf8", before trying to
find it in the list returned by host_locales.

On my development platform, "locale -a" lists C.utf8, which is normalized to
"c.utf8" by host_locales, so there's a match and have_host_locale returns true.

On another platform however, "locale -a" lists C.UTF-8, which is normalized to
"c.utf-8" by host_locales, so there's no match and have_host_locale returns false.

Fix this by also dropping the dash in host_locales.

Tested on x86_64-linux.
---
 gdb/testsuite/lib/gdb.exp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index bcf536e0cc5..1b9179401c4 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -9936,6 +9936,8 @@ gdb_caching_proc host_locales { } {
 
     # Normalize items to lower-case.
     set l [lmap v $l { string tolower $v }]
+    # Normalize items to without dash.
+    set l [lmap v $l { string map { "-" "" } $v }]
 
     return $l
 }

base-commit: 130e33d8617e7663b397f35d34f3c2b2f48d9cfc
-- 
2.35.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-29 15:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-29 15:27 [pushed 1/4] [gdb/testsuite] Fix false negative in have_host_locale Tom de Vries
2023-08-29 15:27 ` [pushed 2/4] [gdb/testsuite] Handle some test-cases with older compiler Tom de Vries
2023-08-29 15:27 ` [pushed 3/4] [gdb/testsuite] Require gcc >= 5 in gdb.linespec/cpls-abi-tag.exp Tom de Vries
2023-08-29 15:27 ` [pushed 4/4] [gdb/testsuite] Require have_compile_flag -mavx512f in gdb.arch/i386-avx512.exp Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).