So, what locale should the regression tests run in?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема So, what locale should the regression tests run in?
Дата
Msg-id 200901140029.40264.peter_e@gmx.net
обсуждение исходный текст
Ответы Re: So, what locale should the regression tests run in?
Список pgsql-hackers
While regress/GNUmakefile appears to make an effort to run the regressions
tests with or without locale depending on the users choice, .e.g.,

# locale
NOLOCALE =
ifdef NO_LOCALE
NOLOCALE += --no-locale
endif

the pg_regress.c implementation spoils that completely by unconditionally
unsetting all locale-related environment variables before initdb.  One part
of the code doesn't know what the other is doing here.

To make it work as designed in GNUmakefile, the patch below would have to
be applied.

This leaves the question, what should really be the default behavior?


diff -u -3 -p -r1.57 pg_regress.c
--- src/test/regress/pg_regress.c       8 Jan 2009 20:09:06 -0000       1.57
+++ src/test/regress/pg_regress.c       13 Jan 2009 21:53:07 -0000
@@ -689,19 +689,22 @@ initialize_environment(void)       /*        * Clear out any non-C locale settings        */
-       unsetenv("LC_COLLATE");
-       unsetenv("LC_CTYPE");
-       unsetenv("LC_MONETARY");
-       unsetenv("LC_MESSAGES");
-       unsetenv("LC_NUMERIC");
-       unsetenv("LC_TIME");
-       unsetenv("LC_ALL");
-       unsetenv("LANG");
-       unsetenv("LANGUAGE");
-       /* On Windows the default locale cannot be English, so force it */
+       if (nolocale)
+       {
+               unsetenv("LC_COLLATE");
+               unsetenv("LC_CTYPE");
+               unsetenv("LC_MONETARY");
+               unsetenv("LC_MESSAGES");
+               unsetenv("LC_NUMERIC");
+               unsetenv("LC_TIME");
+               unsetenv("LC_ALL");
+               unsetenv("LANG");
+               unsetenv("LANGUAGE");
+               /* On Windows the default locale cannot be English, so force it */#if defined(WIN32) ||
defined(__CYGWIN__)
-       putenv("LANG=en");
+               putenv("LANG=en");#endif
+       }
       /*        * Set multibyte as requested


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: A single escape required for log_filename
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: A single escape required for log_filename