Add a --dbname option to the pg_regress script, and use pl_regression
for testing PLs and contrib_regression for testing contrib, instead of overwriting the core system's regression database as formerly done. Andrew Dunstan
This commit is contained in:
parent
f9ad8a2802
commit
4e7d6f5349
@ -1,4 +1,5 @@
|
|||||||
# $PostgreSQL: pgsql/contrib/contrib-global.mk,v 1.8 2004/07/30 12:26:39 petere Exp $
|
# $PostgreSQL: pgsql/contrib/contrib-global.mk,v 1.9 2005/05/17 18:26:22 tgl Exp $
|
||||||
|
|
||||||
NO_PGXS = 1
|
NO_PGXS = 1
|
||||||
|
REGRESS_OPTS = --dbname=$(CONTRIB_TESTDB)
|
||||||
include $(top_srcdir)/src/makefiles/pgxs.mk
|
include $(top_srcdir)/src/makefiles/pgxs.mk
|
||||||
|
@ -98,7 +98,7 @@ SELECT dblink_build_sql_delete('"MySchema"."Foo"','1 2',2,'{"0", "a"}');
|
|||||||
|
|
||||||
-- regular old dblink
|
-- regular old dblink
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM dblink('dbname=regression','SELECT * FROM foo') AS t(a int, b text, c text[])
|
FROM dblink('dbname=contrib_regression','SELECT * FROM foo') AS t(a int, b text, c text[])
|
||||||
WHERE t.a > 7;
|
WHERE t.a > 7;
|
||||||
a | b | c
|
a | b | c
|
||||||
---+---+------------
|
---+---+------------
|
||||||
@ -112,7 +112,7 @@ FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[])
|
|||||||
WHERE t.a > 7;
|
WHERE t.a > 7;
|
||||||
ERROR: connection not available
|
ERROR: connection not available
|
||||||
-- create a persistent connection
|
-- create a persistent connection
|
||||||
SELECT dblink_connect('dbname=regression');
|
SELECT dblink_connect('dbname=contrib_regression');
|
||||||
dblink_connect
|
dblink_connect
|
||||||
----------------
|
----------------
|
||||||
OK
|
OK
|
||||||
@ -260,14 +260,14 @@ WHERE t.a > 7;
|
|||||||
ERROR: connection not available
|
ERROR: connection not available
|
||||||
-- put more data into our slave table, first using arbitrary connection syntax
|
-- put more data into our slave table, first using arbitrary connection syntax
|
||||||
-- but truncate the actual return value so we can use diff to check for success
|
-- but truncate the actual return value so we can use diff to check for success
|
||||||
SELECT substr(dblink_exec('dbname=regression','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
|
SELECT substr(dblink_exec('dbname=contrib_regression','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
|
||||||
substr
|
substr
|
||||||
--------
|
--------
|
||||||
INSERT
|
INSERT
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- create a persistent connection
|
-- create a persistent connection
|
||||||
SELECT dblink_connect('dbname=regression');
|
SELECT dblink_connect('dbname=contrib_regression');
|
||||||
dblink_connect
|
dblink_connect
|
||||||
----------------
|
----------------
|
||||||
OK
|
OK
|
||||||
@ -383,7 +383,7 @@ ERROR: could not establish connection
|
|||||||
DETAIL: missing "=" after "myconn" in connection info string
|
DETAIL: missing "=" after "myconn" in connection info string
|
||||||
|
|
||||||
-- create a named persistent connection
|
-- create a named persistent connection
|
||||||
SELECT dblink_connect('myconn','dbname=regression');
|
SELECT dblink_connect('myconn','dbname=contrib_regression');
|
||||||
dblink_connect
|
dblink_connect
|
||||||
----------------
|
----------------
|
||||||
OK
|
OK
|
||||||
@ -420,10 +420,10 @@ SELECT dblink_exec('myconn','ABORT');
|
|||||||
|
|
||||||
-- create a second named persistent connection
|
-- create a second named persistent connection
|
||||||
-- should error with "duplicate connection name"
|
-- should error with "duplicate connection name"
|
||||||
SELECT dblink_connect('myconn','dbname=regression');
|
SELECT dblink_connect('myconn','dbname=contrib_regression');
|
||||||
ERROR: duplicate connection name
|
ERROR: duplicate connection name
|
||||||
-- create a second named persistent connection with a new name
|
-- create a second named persistent connection with a new name
|
||||||
SELECT dblink_connect('myconn2','dbname=regression');
|
SELECT dblink_connect('myconn2','dbname=contrib_regression');
|
||||||
dblink_connect
|
dblink_connect
|
||||||
----------------
|
----------------
|
||||||
OK
|
OK
|
||||||
@ -540,7 +540,7 @@ ERROR: could not establish connection
|
|||||||
DETAIL: missing "=" after "myconn" in connection info string
|
DETAIL: missing "=" after "myconn" in connection info string
|
||||||
|
|
||||||
-- create a named persistent connection
|
-- create a named persistent connection
|
||||||
SELECT dblink_connect('myconn','dbname=regression');
|
SELECT dblink_connect('myconn','dbname=contrib_regression');
|
||||||
dblink_connect
|
dblink_connect
|
||||||
----------------
|
----------------
|
||||||
OK
|
OK
|
||||||
|
@ -65,7 +65,7 @@ SELECT dblink_build_sql_delete('"MySchema"."Foo"','1 2',2,'{"0", "a"}');
|
|||||||
|
|
||||||
-- regular old dblink
|
-- regular old dblink
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM dblink('dbname=regression','SELECT * FROM foo') AS t(a int, b text, c text[])
|
FROM dblink('dbname=contrib_regression','SELECT * FROM foo') AS t(a int, b text, c text[])
|
||||||
WHERE t.a > 7;
|
WHERE t.a > 7;
|
||||||
|
|
||||||
-- should generate "connection not available" error
|
-- should generate "connection not available" error
|
||||||
@ -74,7 +74,7 @@ FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[])
|
|||||||
WHERE t.a > 7;
|
WHERE t.a > 7;
|
||||||
|
|
||||||
-- create a persistent connection
|
-- create a persistent connection
|
||||||
SELECT dblink_connect('dbname=regression');
|
SELECT dblink_connect('dbname=contrib_regression');
|
||||||
|
|
||||||
-- use the persistent connection
|
-- use the persistent connection
|
||||||
SELECT *
|
SELECT *
|
||||||
@ -138,10 +138,10 @@ WHERE t.a > 7;
|
|||||||
|
|
||||||
-- put more data into our slave table, first using arbitrary connection syntax
|
-- put more data into our slave table, first using arbitrary connection syntax
|
||||||
-- but truncate the actual return value so we can use diff to check for success
|
-- but truncate the actual return value so we can use diff to check for success
|
||||||
SELECT substr(dblink_exec('dbname=regression','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
|
SELECT substr(dblink_exec('dbname=contrib_regression','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
|
||||||
|
|
||||||
-- create a persistent connection
|
-- create a persistent connection
|
||||||
SELECT dblink_connect('dbname=regression');
|
SELECT dblink_connect('dbname=contrib_regression');
|
||||||
|
|
||||||
-- put more data into our slave table, using persistent connection syntax
|
-- put more data into our slave table, using persistent connection syntax
|
||||||
-- but truncate the actual return value so we can use diff to check for success
|
-- but truncate the actual return value so we can use diff to check for success
|
||||||
@ -193,7 +193,7 @@ FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c text[])
|
|||||||
WHERE t.a > 7;
|
WHERE t.a > 7;
|
||||||
|
|
||||||
-- create a named persistent connection
|
-- create a named persistent connection
|
||||||
SELECT dblink_connect('myconn','dbname=regression');
|
SELECT dblink_connect('myconn','dbname=contrib_regression');
|
||||||
|
|
||||||
-- use the named persistent connection
|
-- use the named persistent connection
|
||||||
SELECT *
|
SELECT *
|
||||||
@ -210,10 +210,10 @@ SELECT dblink_exec('myconn','ABORT');
|
|||||||
|
|
||||||
-- create a second named persistent connection
|
-- create a second named persistent connection
|
||||||
-- should error with "duplicate connection name"
|
-- should error with "duplicate connection name"
|
||||||
SELECT dblink_connect('myconn','dbname=regression');
|
SELECT dblink_connect('myconn','dbname=contrib_regression');
|
||||||
|
|
||||||
-- create a second named persistent connection with a new name
|
-- create a second named persistent connection with a new name
|
||||||
SELECT dblink_connect('myconn2','dbname=regression');
|
SELECT dblink_connect('myconn2','dbname=contrib_regression');
|
||||||
|
|
||||||
-- use the second named persistent connection
|
-- use the second named persistent connection
|
||||||
SELECT *
|
SELECT *
|
||||||
@ -263,7 +263,7 @@ FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c text[])
|
|||||||
WHERE t.a > 7;
|
WHERE t.a > 7;
|
||||||
|
|
||||||
-- create a named persistent connection
|
-- create a named persistent connection
|
||||||
SELECT dblink_connect('myconn','dbname=regression');
|
SELECT dblink_connect('myconn','dbname=contrib_regression');
|
||||||
|
|
||||||
-- put more data into our slave table, using named persistent connection syntax
|
-- put more data into our slave table, using named persistent connection syntax
|
||||||
-- but truncate the actual return value so we can use diff to check for success
|
-- but truncate the actual return value so we can use diff to check for success
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# -*-makefile-*-
|
# -*-makefile-*-
|
||||||
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.213 2005/03/25 23:22:53 momjian Exp $
|
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.214 2005/05/17 18:26:22 tgl Exp $
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# All PostgreSQL makefiles include this file and use the variables it sets,
|
# All PostgreSQL makefiles include this file and use the variables it sets,
|
||||||
@ -228,6 +228,9 @@ XGETTEXT = @XGETTEXT@
|
|||||||
GZIP = gzip
|
GZIP = gzip
|
||||||
BZIP2 = bzip2
|
BZIP2 = bzip2
|
||||||
|
|
||||||
|
PL_TESTDB = pl_regression
|
||||||
|
CONTRIB_TESTDB = contrib_regression
|
||||||
|
|
||||||
# Installation.
|
# Installation.
|
||||||
|
|
||||||
INSTALL = $(SHELL) $(top_srcdir)/config/install-sh -c
|
INSTALL = $(SHELL) $(top_srcdir)/config/install-sh -c
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# PGXS: PostgreSQL extensions makefile
|
# PGXS: PostgreSQL extensions makefile
|
||||||
|
|
||||||
# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.3 2004/10/10 16:13:03 tgl Exp $
|
# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.4 2005/05/17 18:26:22 tgl Exp $
|
||||||
|
|
||||||
# This file contains generic rules to build many kinds of simple
|
# This file contains generic rules to build many kinds of simple
|
||||||
# extension modules. You only need to set a few variables and include
|
# extension modules. You only need to set a few variables and include
|
||||||
@ -224,12 +224,12 @@ submake:
|
|||||||
|
|
||||||
# against installed postmaster
|
# against installed postmaster
|
||||||
installcheck: submake
|
installcheck: submake
|
||||||
$(top_builddir)/src/test/regress/pg_regress $(REGRESS)
|
$(SHELL) $(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
|
||||||
|
|
||||||
# in-tree test doesn't work yet (no way to install my shared library)
|
# in-tree test doesn't work yet (no way to install my shared library)
|
||||||
#check: all submake
|
#check: all submake
|
||||||
# $(top_builddir)/src/test/regress/pg_regress --temp-install \
|
# $(SHELL) $(top_builddir)/src/test/regress/pg_regress --temp-install \
|
||||||
# --top-builddir=$(top_builddir) $(REGRESS)
|
# --top-builddir=$(top_builddir) $(REGRESS_OPTS) $(REGRESS)
|
||||||
check:
|
check:
|
||||||
@echo "'make check' is not supported."
|
@echo "'make check' is not supported."
|
||||||
@echo "Do 'make install', then 'make installcheck' instead."
|
@echo "Do 'make install', then 'make installcheck' instead."
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Makefile for PL/Perl
|
# Makefile for PL/Perl
|
||||||
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.19 2005/05/14 17:55:20 tgl Exp $
|
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.20 2005/05/17 18:26:22 tgl Exp $
|
||||||
|
|
||||||
subdir = src/pl/plperl
|
subdir = src/pl/plperl
|
||||||
top_builddir = ../../..
|
top_builddir = ../../..
|
||||||
@ -36,6 +36,7 @@ OBJS = plperl.o spi_internal.o SPI.o
|
|||||||
|
|
||||||
SHLIB_LINK = $(perl_embed_ldflags) $(BE_DLLLIBS)
|
SHLIB_LINK = $(perl_embed_ldflags) $(BE_DLLLIBS)
|
||||||
|
|
||||||
|
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl
|
||||||
REGRESS = plperl
|
REGRESS = plperl
|
||||||
|
|
||||||
include $(top_srcdir)/src/Makefile.shlib
|
include $(top_srcdir)/src/Makefile.shlib
|
||||||
@ -62,7 +63,7 @@ uninstall:
|
|||||||
rm -f $(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)
|
rm -f $(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)
|
||||||
|
|
||||||
installcheck: submake
|
installcheck: submake
|
||||||
$(SHELL) $(top_builddir)/src/test/regress/pg_regress --load-language=plperl $(REGRESS)
|
$(SHELL) $(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
|
||||||
|
|
||||||
.PHONY: submake
|
.PHONY: submake
|
||||||
submake:
|
submake:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.19 2005/05/14 17:55:21 tgl Exp $
|
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.20 2005/05/17 18:26:23 tgl Exp $
|
||||||
|
|
||||||
subdir = src/pl/plpython
|
subdir = src/pl/plpython
|
||||||
top_builddir = ../../..
|
top_builddir = ../../..
|
||||||
@ -58,6 +58,7 @@ endif
|
|||||||
|
|
||||||
SHLIB_LINK = $(BE_DLLLIBS) $(python_libspec) $(python_additional_libs)
|
SHLIB_LINK = $(BE_DLLLIBS) $(python_libspec) $(python_additional_libs)
|
||||||
|
|
||||||
|
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plpythonu
|
||||||
REGRESS = plpython_schema plpython_populate plpython_function plpython_test plpython_error plpython_drop
|
REGRESS = plpython_schema plpython_populate plpython_function plpython_test plpython_error plpython_drop
|
||||||
|
|
||||||
include $(top_srcdir)/src/Makefile.shlib
|
include $(top_srcdir)/src/Makefile.shlib
|
||||||
@ -81,7 +82,7 @@ uninstall:
|
|||||||
rm -f $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)
|
rm -f $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)
|
||||||
|
|
||||||
installcheck: submake
|
installcheck: submake
|
||||||
$(SHELL) $(top_builddir)/src/test/regress/pg_regress --load-language=plpythonu $(REGRESS)
|
$(SHELL) $(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
|
||||||
|
|
||||||
.PHONY: submake
|
.PHONY: submake
|
||||||
submake:
|
submake:
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Makefile for the pltcl shared object
|
# Makefile for the pltcl shared object
|
||||||
#
|
#
|
||||||
# $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.45 2005/05/14 17:55:22 tgl Exp $
|
# $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.46 2005/05/17 18:26:23 tgl Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -40,6 +40,7 @@ SO_MAJOR_VERSION = 2
|
|||||||
SO_MINOR_VERSION = 0
|
SO_MINOR_VERSION = 0
|
||||||
OBJS = pltcl.o
|
OBJS = pltcl.o
|
||||||
|
|
||||||
|
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=pltcl
|
||||||
REGRESS = pltcl_setup pltcl_queries
|
REGRESS = pltcl_setup pltcl_queries
|
||||||
|
|
||||||
include $(top_srcdir)/src/Makefile.shlib
|
include $(top_srcdir)/src/Makefile.shlib
|
||||||
@ -68,7 +69,7 @@ uninstall:
|
|||||||
$(MAKE) -C modules $@
|
$(MAKE) -C modules $@
|
||||||
|
|
||||||
installcheck: submake
|
installcheck: submake
|
||||||
$(SHELL) $(top_builddir)/src/test/regress/pg_regress --load-language=pltcl $(REGRESS)
|
$(SHELL) $(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS)
|
||||||
|
|
||||||
.PHONY: submake
|
.PHONY: submake
|
||||||
submake:
|
submake:
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.54 2005/05/11 21:52:03 tgl Exp $
|
# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.55 2005/05/17 18:26:23 tgl Exp $
|
||||||
|
|
||||||
me=`basename $0`
|
me=`basename $0`
|
||||||
: ${TMPDIR=/tmp}
|
: ${TMPDIR=/tmp}
|
||||||
@ -11,6 +11,7 @@ PostgreSQL regression test driver
|
|||||||
Usage: $me [options...] [extra tests...]
|
Usage: $me [options...] [extra tests...]
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
--dbname=DB use database DB (default \`regression')
|
||||||
--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
|
--load-language=lang load the named language before running the
|
||||||
@ -123,6 +124,9 @@ do
|
|||||||
--version)
|
--version)
|
||||||
echo "pg_regress (PostgreSQL @VERSION@)"
|
echo "pg_regress (PostgreSQL @VERSION@)"
|
||||||
exit 0;;
|
exit 0;;
|
||||||
|
--dbname=*)
|
||||||
|
dbname=`expr "x$1" : "x--dbname=\(.*\)"`
|
||||||
|
shift;;
|
||||||
--debug)
|
--debug)
|
||||||
debug=yes
|
debug=yes
|
||||||
shift;;
|
shift;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user