Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 35eb095

Browse files
committed
Don't run regression tests in SQL_ASCII encoding by default
Instead, run them in the encoding that the locale selects, which is more representative of real use. Also document how locale and encoding for regression test runs can be selected.
1 parent a0423ec commit 35eb095

File tree

2 files changed

+43
-4
lines changed

2 files changed

+43
-4
lines changed

doc/src/sgml/regress.sgml

+42
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,48 @@ gmake standbycheck
194194
Additional automated testing may be available in later releases.
195195
</para>
196196
</sect2>
197+
198+
<sect2>
199+
<title>Locale and encoding</title>
200+
201+
<para>
202+
By default, the tests against a temporary installation use the
203+
locale defined in the current environment and the corresponding
204+
database encoding as determined by <command>initdb</command>. It
205+
can be useful to test different locales by setting the appropriate
206+
environment variables, for example:
207+
<screen>
208+
gmake check LANG=C
209+
gmake check LC_COLLATE=en_US.utf8 LC_CTYPE=fr_CA.utf8
210+
</screen>
211+
For implementation reasons, setting <envar>LC_ALL</envar> does not
212+
work for this purpose; all the other locale-related environment
213+
variables do work.
214+
</para>
215+
216+
<para>
217+
When testing against an existing installation, the locale is
218+
determined by the existing database cluster and cannot be set
219+
separately for the test run.
220+
</para>
221+
222+
<para>
223+
You can also choose the database encoding explicitly by setting
224+
the variable <envar>MULTIBYTE</envar>, for example:
225+
<screen>
226+
gmake check LANG=C MULTIBYTE=EUC_JP
227+
</screen>
228+
Setting the database encoding this way typically only makes sense
229+
if the locale is C; otherwise the encoding is chosen automatically
230+
from the locale, and specifying an encoding that does not match
231+
the locale will result in an error.
232+
</para>
233+
234+
<para>
235+
The encoding can be set for tests against a temporary or an
236+
existing installation.
237+
</para>
238+
</sect2>
197239
</sect1>
198240

199241
<sect1 id="regress-evaluation">

src/test/regress/GNUmakefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ endif
2323
# where to find psql for testing an existing installation
2424
PSQLDIR = $(bindir)
2525

26-
# default encoding
27-
MULTIBYTE = SQL_ASCII
28-
2926
# maximum simultaneous connections for parallel tests
3027
MAXCONNOPT =
3128
ifdef MAX_CONNECTIONS
@@ -141,7 +138,7 @@ tablespace-setup:
141138
## Run tests
142139
##
143140

144-
pg_regress_call = ./pg_regress --inputdir=$(srcdir) --dlpath=. --multibyte=$(MULTIBYTE) $(NOLOCALE)
141+
pg_regress_call = ./pg_regress --inputdir=$(srcdir) --dlpath=. $(if $(MULTIBYTE),--multibyte=$(MULTIBYTE)) $(NOLOCALE)
145142

146143
check: all tablespace-setup
147144
$(pg_regress_call) --temp-install=./tmp_check --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(TEMP_CONF)

0 commit comments

Comments
 (0)