]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Provide a --no-locale option for pg_regress and a corresponding NOLOCALE=1
authorAndrew Dunstan <andrew@dunslane.net>
Tue, 1 Nov 2005 15:32:52 +0000 (15:32 +0000)
committerAndrew Dunstan <andrew@dunslane.net>
Tue, 1 Nov 2005 15:32:52 +0000 (15:32 +0000)
setting for the regression makefile, allowing Windows users to force locale
settings since Windows does not get its locale from the environment.

Per Petr Jelinek.

src/test/regress/GNUmakefile
src/test/regress/pg_regress.sh

index 646aceb66642b5c84b3958c5656f7ac2a2792827..822147b8b6753b64746e65f722c3aa75c2f94ab9 100644 (file)
@@ -7,7 +7,7 @@
 #
 #
 # IDENTIFICATION
-#    $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.48.4.1 2005/07/17 18:29:13 tgl Exp $
+#    $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.48.4.2 2005/11/01 15:32:52 adunstan Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -34,6 +34,11 @@ ifdef MAX_CONNECTIONS
 MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
 endif
 
+# locale
+NOLOCALE :=
+ifdef NO_LOCALE
+NOLOCALE += --no-locale
+endif
 
 ##
 ## Prepare for tests
@@ -133,17 +138,17 @@ all-spi:
 check: all
        -rm -rf ./testtablespace
        mkdir ./testtablespace
-       $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT)
+       $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT) $(NOLOCALE)
 
 installcheck: all
        -rm -rf ./testtablespace
        mkdir ./testtablespace
-       $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)
+       $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) $(NOLOCALE)
 
 installcheck-parallel: all
        -rm -rf ./testtablespace
        mkdir ./testtablespace
-       $(SHELL) ./pg_regress --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT)
+       $(SHELL) ./pg_regress --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT) $(NOLOCALE)
 
 
 # old interfaces follow...
@@ -153,10 +158,10 @@ runtest: installcheck
 runtest-parallel: installcheck-parallel
 
 bigtest:
-       $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) numeric_big
+       $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) $(NOLOCALE) numeric_big
 
 bigcheck:
-       $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT) numeric_big
+       $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT) $(NOLOCALE) numeric_big
 
 
 ##
index aeb385b9ec6042a344357423eeb2a1ae2bf45af1..0a9d97f451cd0a1860abb9f96e0eaa7f70d15b2a 100644 (file)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.53.4.1 2005/07/17 18:29:13 tgl Exp $
+# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.53.4.2 2005/11/01 15:32:52 adunstan Exp $
 
 me=`basename $0`
 : ${TMPDIR=/tmp}
@@ -21,6 +21,7 @@ Options:
   --schedule=FILE           use test ordering schedule from FILE
                             (may be used multiple times to concatenate)
   --temp-install[=DIR]      create a temporary installation (in DIR)
+  --no-locale               use C locale
 
 Options for \`temp-install' mode:
   --top-builddir=DIR        (relative) path to top level build directory
@@ -97,6 +98,7 @@ fi
 unset mode
 unset schedule
 unset debug
+unset nolocale
 unset top_builddir
 unset temp_install
 unset multibyte
@@ -131,6 +133,9 @@ do
         --multibyte=*)
                 multibyte=`expr "x$1" : "x--multibyte=\(.*\)"`
                 shift;;
+        --no-locale)
+                nolocale=yes
+                shift;;
         --temp-install)
                 temp_install=./tmp_check
                 shift;;
@@ -408,7 +413,8 @@ then
     rm $backup
 
     message "initializing database system"
-    [ "$debug" = yes ] && initdb_options='--debug'
+    [ "$debug" = yes ] && initdb_options="--debug"
+    [ "$nolocale" = yes ] && initdb_options="$initdb_options --no-locale"
     "$bindir/initdb" -D "$PGDATA" -L "$datadir" --noclean $initdb_options >"$LOGDIR/initdb.log" 2>&1
 
     if [ $? -ne 0 ]