From: Bruno Haible Date: Mon, 27 May 2024 20:33:33 +0000 (+0200) Subject: tests: Fix internationalization problems on native Windows. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=c1b1d9d5328530fc3a27c8d11a6845f19a14a3f2;p=gnulib.git tests: Fix internationalization problems on native Windows. * doc/posix-functions/setlocale.texi: Clarify the deficiency of setlocale() on native Windows. * modules/dfa-tests (Depends-on): Add setlocale. * modules/hard-locale-tests (Depends-on): Likewise. * modules/localcharset-tests (Depends-on): Likewise. * modules/nstrftime-tests (Depends-on): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 09bac4cd08..b191bca752 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2024-05-27 Bruno Haible + + tests: Fix internationalization problems on native Windows. + * doc/posix-functions/setlocale.texi: Clarify the deficiency of + setlocale() on native Windows. + * modules/dfa-tests (Depends-on): Add setlocale. + * modules/hard-locale-tests (Depends-on): Likewise. + * modules/localcharset-tests (Depends-on): Likewise. + * modules/nstrftime-tests (Depends-on): Likewise. + 2024-05-27 Bruno Haible parse-datetime tests: Avoid failure on native Windows. diff --git a/doc/posix-functions/setlocale.texi b/doc/posix-functions/setlocale.texi index 6e232200f8..2798e224cb 100644 --- a/doc/posix-functions/setlocale.texi +++ b/doc/posix-functions/setlocale.texi @@ -9,9 +9,9 @@ Gnulib module: setlocale, setlocale-null Portability problems fixed by Gnulib module @code{setlocale}: @itemize @item -On Windows platforms (excluding Cygwin), @code{setlocale(@var{category},NULL)} -ignores the environment variables @code{LC_ALL}, @code{@var{category}}, and -@code{LANG}. +On Windows platforms (excluding Cygwin), @code{setlocale(@var{category},"")} +and @code{setlocale(@var{category},NULL)} both ignore the environment variables +@code{LC_ALL}, @code{@var{category}}, and @code{LANG}. @item On Windows platforms (excluding Cygwin) and Cygwin 1.5.x, @code{setlocale(LC_ALL,@var{name})} succeeds and sets the LC_CTYPE category to diff --git a/modules/dfa-tests b/modules/dfa-tests index 42606e8781..097c7a75ea 100644 --- a/modules/dfa-tests +++ b/modules/dfa-tests @@ -11,6 +11,7 @@ stdlib string unistd regex +setlocale test-framework-sh configure.ac: diff --git a/modules/hard-locale-tests b/modules/hard-locale-tests index e4bc65a256..cac960621f 100644 --- a/modules/hard-locale-tests +++ b/modules/hard-locale-tests @@ -4,6 +4,7 @@ tests/locale.c m4/musl.m4 Depends-on: +setlocale configure.ac: gl_MUSL_LIBC diff --git a/modules/localcharset-tests b/modules/localcharset-tests index cb84f2cdc7..3f2dde6dfd 100644 --- a/modules/localcharset-tests +++ b/modules/localcharset-tests @@ -2,6 +2,7 @@ Files: tests/test-localcharset.c Depends-on: +setlocale configure.ac: diff --git a/modules/nstrftime-tests b/modules/nstrftime-tests index ed2430accd..52b99aa802 100644 --- a/modules/nstrftime-tests +++ b/modules/nstrftime-tests @@ -6,6 +6,7 @@ Depends-on: atoll c99 intprops +setlocale strerror configure.ac: