Commit 34b788d6 authored by Tom Lane's avatar Tom Lane

Give pg_regress a --load-language option, so that it can be used to test

other PLs besides plpgsql.  Andrew Dunstan
parent cc99c57e
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.48 2004/11/17 18:05:06 tgl Exp $ # $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.49 2005/05/11 21:52:03 tgl Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
...@@ -130,17 +130,17 @@ all-spi: ...@@ -130,17 +130,17 @@ all-spi:
check: all check: all
-rm -rf ./testtablespace -rm -rf ./testtablespace
mkdir ./testtablespace mkdir ./testtablespace
$(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT) $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT)
installcheck: all installcheck: all
-rm -rf ./testtablespace -rm -rf ./testtablespace
mkdir ./testtablespace mkdir ./testtablespace
$(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql
installcheck-parallel: all installcheck-parallel: all
-rm -rf ./testtablespace -rm -rf ./testtablespace
mkdir ./testtablespace mkdir ./testtablespace
$(SHELL) ./pg_regress --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT) $(SHELL) ./pg_regress --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT)
# old interfaces follow... # old interfaces follow...
...@@ -150,10 +150,10 @@ runtest: installcheck ...@@ -150,10 +150,10 @@ runtest: installcheck
runtest-parallel: installcheck-parallel runtest-parallel: installcheck-parallel
bigtest: bigtest:
$(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) numeric_big $(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql numeric_big
bigcheck: bigcheck:
$(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT) numeric_big $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) numeric_big
## ##
......
#! /bin/sh #! /bin/sh
# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.53 2005/01/15 04:15:51 tgl Exp $ # $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.54 2005/05/11 21:52:03 tgl Exp $
me=`basename $0` me=`basename $0`
: ${TMPDIR=/tmp} : ${TMPDIR=/tmp}
...@@ -13,6 +13,8 @@ Usage: $me [options...] [extra tests...] ...@@ -13,6 +13,8 @@ Usage: $me [options...] [extra tests...]
Options: Options:
--debug turn on debug mode in programs that are run --debug turn on debug mode in programs that are run
--inputdir=DIR take input files from DIR (default \`.') --inputdir=DIR take input files from DIR (default \`.')
--load-language=lang load the named language before running the
tests; can appear multiple times
--max-connections=N maximum number of concurrent connections --max-connections=N maximum number of concurrent connections
(default is 0 meaning unlimited) (default is 0 meaning unlimited)
--multibyte=ENCODING use ENCODING as the multibyte encoding, and --multibyte=ENCODING use ENCODING as the multibyte encoding, and
...@@ -103,6 +105,7 @@ unset multibyte ...@@ -103,6 +105,7 @@ unset multibyte
dbname=regression dbname=regression
hostname=localhost hostname=localhost
maxconnections=0 maxconnections=0
load_langs=""
: ${GMAKE='@GMAKE@'} : ${GMAKE='@GMAKE@'}
...@@ -126,6 +129,11 @@ do ...@@ -126,6 +129,11 @@ do
--inputdir=*) --inputdir=*)
inputdir=`expr "x$1" : "x--inputdir=\(.*\)"` inputdir=`expr "x$1" : "x--inputdir=\(.*\)"`
shift;; shift;;
--load-language=*)
lang=`expr "x$1" : "x--load-language=\(.*\)"`
load_langs="$load_langs $lang"
unset lang
shift;;
--multibyte=*) --multibyte=*)
multibyte=`expr "x$1" : "x--multibyte=\(.*\)"` multibyte=`expr "x$1" : "x--multibyte=\(.*\)"`
shift;; shift;;
...@@ -560,16 +568,20 @@ fi ...@@ -560,16 +568,20 @@ fi
# ---------- # ----------
# Install the PL/pgSQL language in it # Install any requested PL languages
# ---------- # ----------
if [ "$enable_shared" = yes ]; then if [ "$enable_shared" = yes ]; then
message "installing PL/pgSQL" for lang in xyzzy $load_langs ; do
"$bindir/createlang" -L "$pkglibdir" $psql_options plpgsql $dbname if [ "$lang" != "xyzzy" ]; then
if [ $? -ne 0 ] && [ $? -ne 2 ]; then message "installing $lang"
echo "$me: createlang failed" "$bindir/createlang" -L "$pkglibdir" $psql_options $lang $dbname
(exit 2); exit if [ $? -ne 0 ] && [ $? -ne 2 ]; then
echo "$me: createlang $lang failed"
(exit 2); exit
fi
fi fi
done
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment