From: Peter Eisentraut Date: Fri, 15 Apr 2011 05:42:05 +0000 (+0300) Subject: Rename pg_regress option --multibyte to --encoding X-Git-Tag: REL9_1_BETA1~94 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f536d4194293f900577c728bfa4e62075a4c7da0;p=postgresql Rename pg_regress option --multibyte to --encoding Also refactor things a little bit so that the same methods for setting test locale and encoding can be used everywhere. --- diff --git a/contrib/unaccent/Makefile b/contrib/unaccent/Makefile index 13cd8538d3..f0be62db53 100644 --- a/contrib/unaccent/Makefile +++ b/contrib/unaccent/Makefile @@ -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 diff --git a/doc/src/sgml/regress.sgml b/doc/src/sgml/regress.sgml index 6f5e2b1ab8..874d45615e 100644 --- a/doc/src/sgml/regress.sgml +++ b/doc/src/sgml/regress.sgml @@ -221,9 +221,9 @@ gmake check LC_COLLATE=en_US.utf8 LC_CTYPE=fr_CA.utf8 You can also choose the database encoding explicitly by setting - the variable MULTIBYTE, for example: + the variable ENCODING, for example: -gmake check LANG=C MULTIBYTE=EUC_JP +gmake check LANG=C ENCODING=EUC_JP Setting the database encoding this way typically only makes sense if the locale is C; otherwise the encoding is chosen automatically diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 69512ac643..56f282712d 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -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/ diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile index 5718ae97b3..7ee8287cab 100644 --- a/src/interfaces/ecpg/test/Makefile +++ b/src/interfaces/ecpg/test/Makefile @@ -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 diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile index 120d07087c..90aea6cc82 100644 --- a/src/test/regress/GNUmakefile +++ b/src/test/regress/GNUmakefile @@ -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) diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index c639c479e4..b9ae622b04 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -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}, diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index 2fe6b8a05b..ac7e6aac2a 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -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\""