]> granicus.if.org Git - postgresql/commitdiff
Rename pg_regress option --multibyte to --encoding
authorPeter Eisentraut <peter_e@gmx.net>
Fri, 15 Apr 2011 05:42:05 +0000 (08:42 +0300)
committerPeter Eisentraut <peter_e@gmx.net>
Fri, 15 Apr 2011 05:42:05 +0000 (08:42 +0300)
Also refactor things a little bit so that the same methods for setting
test locale and encoding can be used everywhere.

contrib/unaccent/Makefile
doc/src/sgml/regress.sgml
src/Makefile.global.in
src/interfaces/ecpg/test/Makefile
src/test/regress/GNUmakefile
src/test/regress/pg_regress.c
src/tools/msvc/vcregress.pl

index 13cd8538d3941be2d5494840559af94f404969b8..f0be62db53fa362aade17e424ef8fc47b77bf6ea 100644 (file)
@@ -9,8 +9,9 @@ DATA_TSEARCH = unaccent.rules
 
 REGRESS = unaccent
 
-# Adjust REGRESS_OPTS because we need a UTF8 database
-REGRESS_OPTS = --dbname=$(CONTRIB_TESTDB) --multibyte=UTF8 --no-locale
+# We need a UTF8 database
+ENCODING = UTF8
+NO_LOCALE = 1
 
 ifdef USE_PGXS
 PG_CONFIG = pg_config
index 6f5e2b1ab888326572456c378bfa0f149e86651c..874d45615e2cdc2b4172227ce823a979f3e76b48 100644 (file)
@@ -221,9 +221,9 @@ gmake check LC_COLLATE=en_US.utf8 LC_CTYPE=fr_CA.utf8
 
    <para>
     You can also choose the database encoding explicitly by setting
-    the variable <envar>MULTIBYTE</envar>, for example:
+    the variable <envar>ENCODING</envar>, for example:
 <screen>
-gmake check LANG=C MULTIBYTE=EUC_JP
+gmake check LANG=C ENCODING=EUC_JP
 </screen>
     Setting the database encoding this way typically only makes sense
     if the locale is C; otherwise the encoding is chosen automatically
index 69512ac6437db97e303e112eebc8bb029e25b9fe..56f282712db2130f1da657a49e3dd0f1a52794ea 100644 (file)
@@ -430,8 +430,14 @@ submake-libpgport:
 PL_TESTDB = pl_regression
 CONTRIB_TESTDB = contrib_regression
 
-pg_regress_check = $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --temp-install=./tmp_check --top-builddir=$(top_builddir)
-pg_regress_installcheck = $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir=$(PSQLDIR)
+ifdef NO_LOCALE
+NOLOCALE += --no-locale
+endif
+
+pg_regress_locale_flags = $(if $(ENCODING),--encoding=$(ENCODING)) $(NOLOCALE)
+
+pg_regress_check = $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --temp-install=./tmp_check --top-builddir=$(top_builddir) $(pg_regress_locale_flags)
+pg_regress_installcheck = $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir=$(PSQLDIR) $(pg_regress_locale_flags)
 
 pg_regress_clean_files = results/ regression.diffs regression.out tmp_check/ log/
 
index 5718ae97b3265dafa66d8b031134d337c9ff6089..7ee8287cab395daec99a8fca71ba8cec5daf7e31 100644 (file)
@@ -16,14 +16,8 @@ override CPPFLAGS := \
 # where to find psql for testing an existing installation
 PSQLDIR = $(bindir)
 
-# default encoding
-MULTIBYTE = SQL_ASCII
-
-# locale
-NOLOCALE =
-ifdef NO_LOCALE
-NOLOCALE += --no-locale
-endif
+# default encoding for regression tests
+ENCODING = SQL_ASCII
 
 ifneq ($(build_os),mingw32)
 abs_builddir := $(shell pwd)
@@ -83,11 +77,11 @@ endif
 
 
 check: all
-       ./pg_regress  --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check --multibyte=$(MULTIBYTE) $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb
+       ./pg_regress  --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb
 
 # the same options, but with --listen-on-tcp
 checktcp: all
-       ./pg_regress  --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check --multibyte=$(MULTIBYTE) $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule_tcp --create-role=connectuser,connectdb --host=localhost
+       ./pg_regress  --dbname=regress1,connectdb --top-builddir=$(top_builddir) --temp-install=./tmp_check $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule_tcp --create-role=connectuser,connectdb --host=localhost
 
 installcheck: all
-       ./pg_regress  --psqldir=$(PSQLDIR) --dbname=regress1,connectdb --top-builddir=$(top_builddir) --multibyte=$(MULTIBYTE) $(NOLOCALE) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb
+       ./pg_regress  --psqldir=$(PSQLDIR) --dbname=regress1,connectdb --top-builddir=$(top_builddir) $(pg_regress_locale_flags) $(THREAD) --schedule=$(srcdir)/ecpg_schedule --create-role=connectuser,connectdb
index 120d07087ccf4211eea771cfb26727234e1819c4..90aea6cc82aa43d64430740a868040e541a6458b 100644 (file)
@@ -29,12 +29,6 @@ ifdef MAX_CONNECTIONS
 MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
 endif
 
-# locale
-NOLOCALE =
-ifdef NO_LOCALE
-NOLOCALE += --no-locale
-endif
-
 # stuff to pass into build of pg_regress
 EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
        '-DMAKEPROG="$(MAKE)"' \
@@ -138,7 +132,7 @@ tablespace-setup:
 ## Run tests
 ##
 
-REGRESS_OPTS = --dlpath=. $(if $(MULTIBYTE),--multibyte=$(MULTIBYTE)) $(NOLOCALE)
+REGRESS_OPTS = --dlpath=.
 
 check: all tablespace-setup
        $(pg_regress_check) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(TEMP_CONF) $(EXTRA_TESTS)
index c639c479e4db3de73ff8b9a415853eddacf0f17f..b9ae622b04b0d272672249ec2ccba8838201fb97 100644 (file)
@@ -727,7 +727,7 @@ initialize_environment(void)
        putenv("LC_MESSAGES=C");
 
        /*
-        * Set multibyte as requested
+        * Set encoding as requested
         */
        if (encoding)
                doputenv("PGCLIENTENCODING", encoding);
@@ -1880,7 +1880,7 @@ help(void)
        printf(_("  --create-role=ROLE        create the specified role before testing\n"));
        printf(_("  --max-connections=N       maximum number of concurrent connections\n"));
        printf(_("                            (default is 0 meaning unlimited)\n"));
-       printf(_("  --multibyte=ENCODING      use ENCODING as the multibyte encoding\n"));
+       printf(_("  --encoding=ENCODING       use ENCODING as the encoding\n"));
        printf(_("  --outputdir=DIR           place output files in DIR (default \".\")\n"));
        printf(_("  --schedule=FILE           use test ordering schedule from FILE\n"));
        printf(_("                            (can be used multiple times to concatenate)\n"));
@@ -1925,7 +1925,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
                {"inputdir", required_argument, NULL, 3},
                {"load-language", required_argument, NULL, 4},
                {"max-connections", required_argument, NULL, 5},
-               {"multibyte", required_argument, NULL, 6},
+               {"encoding", required_argument, NULL, 6},
                {"outputdir", required_argument, NULL, 7},
                {"schedule", required_argument, NULL, 8},
                {"temp-install", required_argument, NULL, 9},
index 2fe6b8a05bec82a2464ba3e83ce263170a40f17e..ac7e6aac2a42e52789bd735c6ea22bac0d6a78f5 100644 (file)
@@ -88,7 +88,7 @@ sub installcheck
     my @args = (
         "../../../$Config/pg_regress/pg_regress","--dlpath=.",
         "--psqldir=../../../$Config/psql","--schedule=${schedule}_schedule",
-        "--multibyte=SQL_ASCII","--no-locale"
+        "--encoding=SQL_ASCII","--no-locale"
     );
     push(@args,$maxconn) if $maxconn;
     system(@args);
@@ -101,7 +101,7 @@ sub check
     my @args = (
         "../../../$Config/pg_regress/pg_regress","--dlpath=.",
         "--psqldir=../../../$Config/psql","--schedule=${schedule}_schedule",
-        "--multibyte=SQL_ASCII","--no-locale",
+        "--encoding=SQL_ASCII","--no-locale",
         "--temp-install=./tmp_check","--top-builddir=\"$topdir\""
     );
     push(@args,$maxconn) if $maxconn;
@@ -125,7 +125,7 @@ sub ecpgcheck
         "--dbname=regress1,connectdb",
         "--create-role=connectuser,connectdb",
         "--schedule=${schedule}_schedule",
-        "--multibyte=SQL_ASCII",
+        "--encoding=SQL_ASCII",
         "--no-locale",
         "--temp-install=./tmp_chk",
         "--top-builddir=\"$topdir\""