summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2009-02-12 13:26:03 +0000
committerPeter Eisentraut2009-02-12 13:26:03 +0000
commit85cb8082d6d92d97240cc661616247daf0de30b6 (patch)
treeafd9f34add6fcb3bea415a1356a1e1b0f5803b2f
parentbe660f58209c22de81f0dbf393100bbb352470fa (diff)
Unset language-related locale settings in any case, otherwise psql will
speak in tongues and mess up the regression test diffs.
-rw-r--r--doc/src/sgml/regress.sgml10
-rw-r--r--src/test/regress/pg_regress.c13
2 files changed, 17 insertions, 6 deletions
diff --git a/doc/src/sgml/regress.sgml b/doc/src/sgml/regress.sgml
index 3ca4cfa8e2..833a08c44e 100644
--- a/doc/src/sgml/regress.sgml
+++ b/doc/src/sgml/regress.sgml
@@ -218,11 +218,15 @@ gmake installcheck
locale-related environment variables on
the <command>make</command> command line, for example:
<programlisting>
-gmake check LC_ALL=de_DE.utf8
+gmake check LANG=de_DE.utf8
</programlisting>
- or analogously to use no locale:
+ (The regression test driver unsets <envar>LC_ALL</envar>, so it
+ does not work to choose the locale using that variable.) To use
+ no locale, either unset all locale-related environment variables
+ (or set them to <literal>C</literal>) or use the following
+ special invocation:
<programlisting>
-gmake check LC_ALL=C
+gmake check NO_LOCALE=1
</programlisting>
When running the tests against an existing installation, the
locale setup is determined by the existing installation. To
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 944596509b..1cd804aa74 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -694,12 +694,9 @@ initialize_environment(void)
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");
@@ -707,6 +704,16 @@ initialize_environment(void)
}
/*
+ * Set translation-related settings to English; otherwise psql
+ * will produce translated messages and produce diffs. (XXX If we
+ * ever support translation of pg_regress, this needs to be moved
+ * elsewhere, where psql is actually called.)
+ */
+ unsetenv("LANGUAGE");
+ unsetenv("LC_ALL");
+ putenv("LC_MESSAGES=C");
+
+ /*
* Set multibyte as requested
*/
if (encoding)