Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4e7d6f5

Browse files
committed
Add a --dbname option to the pg_regress script, and use pl_regression
for testing PLs and contrib_regression for testing contrib, instead ofoverwriting the core system's regression database as formerly done.Andrew Dunstan
1 parentf9ad8a2 commit4e7d6f5

File tree

9 files changed

+40
-29
lines changed

9 files changed

+40
-29
lines changed

‎contrib/contrib-global.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# $PostgreSQL: pgsql/contrib/contrib-global.mk,v 1.8 2004/07/30 12:26:39 petere Exp $
1+
# $PostgreSQL: pgsql/contrib/contrib-global.mk,v 1.9 2005/05/17 18:26:22 tgl Exp $
22

33
NO_PGXS = 1
4+
REGRESS_OPTS = --dbname=$(CONTRIB_TESTDB)
45
include$(top_srcdir)/src/makefiles/pgxs.mk

‎contrib/dblink/expected/dblink.out

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ SELECT dblink_build_sql_delete('"MySchema"."Foo"','1 2',2,'{"0", "a"}');
9898

9999
-- regular old dblink
100100
SELECT *
101-
FROM dblink('dbname=regression','SELECT * FROM foo') AS t(a int, b text, c text[])
101+
FROM dblink('dbname=contrib_regression','SELECT * FROM foo') AS t(a int, b text, c text[])
102102
WHERE t.a > 7;
103103
a | b | c
104104
---+---+------------
@@ -112,7 +112,7 @@ FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[])
112112
WHERE t.a > 7;
113113
ERROR: connection not available
114114
-- create a persistent connection
115-
SELECT dblink_connect('dbname=regression');
115+
SELECT dblink_connect('dbname=contrib_regression');
116116
dblink_connect
117117
----------------
118118
OK
@@ -260,14 +260,14 @@ WHERE t.a > 7;
260260
ERROR: connection not available
261261
-- put more data into our slave table, first using arbitrary connection syntax
262262
-- but truncate the actual return value so we can use diff to check for success
263-
SELECT substr(dblink_exec('dbname=regression','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
263+
SELECT substr(dblink_exec('dbname=contrib_regression','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
264264
substr
265265
--------
266266
INSERT
267267
(1 row)
268268

269269
-- create a persistent connection
270-
SELECT dblink_connect('dbname=regression');
270+
SELECT dblink_connect('dbname=contrib_regression');
271271
dblink_connect
272272
----------------
273273
OK
@@ -383,7 +383,7 @@ ERROR: could not establish connection
383383
DETAIL: missing "=" after "myconn" in connection info string
384384

385385
-- create a named persistent connection
386-
SELECT dblink_connect('myconn','dbname=regression');
386+
SELECT dblink_connect('myconn','dbname=contrib_regression');
387387
dblink_connect
388388
----------------
389389
OK
@@ -420,10 +420,10 @@ SELECT dblink_exec('myconn','ABORT');
420420

421421
-- create a second named persistent connection
422422
-- should error with "duplicate connection name"
423-
SELECT dblink_connect('myconn','dbname=regression');
423+
SELECT dblink_connect('myconn','dbname=contrib_regression');
424424
ERROR: duplicate connection name
425425
-- create a second named persistent connection with a new name
426-
SELECT dblink_connect('myconn2','dbname=regression');
426+
SELECT dblink_connect('myconn2','dbname=contrib_regression');
427427
dblink_connect
428428
----------------
429429
OK
@@ -540,7 +540,7 @@ ERROR: could not establish connection
540540
DETAIL: missing "=" after "myconn" in connection info string
541541

542542
-- create a named persistent connection
543-
SELECT dblink_connect('myconn','dbname=regression');
543+
SELECT dblink_connect('myconn','dbname=contrib_regression');
544544
dblink_connect
545545
----------------
546546
OK

‎contrib/dblink/sql/dblink.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ SELECT dblink_build_sql_delete('"MySchema"."Foo"','1 2',2,'{"0", "a"}');
6565

6666
-- regular old dblink
6767
SELECT*
68-
FROM dblink('dbname=regression','SELECT * FROM foo')AS t(aint, btext, ctext[])
68+
FROM dblink('dbname=contrib_regression','SELECT * FROM foo')AS t(aint, btext, ctext[])
6969
WHEREt.a>7;
7070

7171
-- should generate "connection not available" error
@@ -74,7 +74,7 @@ FROM dblink('SELECT * FROM foo') AS t(a int, b text, c text[])
7474
WHEREt.a>7;
7575

7676
-- create a persistent connection
77-
SELECT dblink_connect('dbname=regression');
77+
SELECT dblink_connect('dbname=contrib_regression');
7878

7979
-- use the persistent connection
8080
SELECT*
@@ -138,10 +138,10 @@ WHERE t.a > 7;
138138

139139
-- put more data into our slave table, first using arbitrary connection syntax
140140
-- but truncate the actual return value so we can use diff to check for success
141-
SELECT substr(dblink_exec('dbname=regression','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
141+
SELECT substr(dblink_exec('dbname=contrib_regression','INSERT INTO foo VALUES(10,''k'',''{"a10","b10","c10"}'')'),1,6);
142142

143143
-- create a persistent connection
144-
SELECT dblink_connect('dbname=regression');
144+
SELECT dblink_connect('dbname=contrib_regression');
145145

146146
-- put more data into our slave table, using persistent connection syntax
147147
-- 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[])
193193
WHEREt.a>7;
194194

195195
-- create a named persistent connection
196-
SELECT dblink_connect('myconn','dbname=regression');
196+
SELECT dblink_connect('myconn','dbname=contrib_regression');
197197

198198
-- use the named persistent connection
199199
SELECT*
@@ -210,10 +210,10 @@ SELECT dblink_exec('myconn','ABORT');
210210

211211
-- create a second named persistent connection
212212
-- should error with "duplicate connection name"
213-
SELECT dblink_connect('myconn','dbname=regression');
213+
SELECT dblink_connect('myconn','dbname=contrib_regression');
214214

215215
-- create a second named persistent connection with a new name
216-
SELECT dblink_connect('myconn2','dbname=regression');
216+
SELECT dblink_connect('myconn2','dbname=contrib_regression');
217217

218218
-- use the second named persistent connection
219219
SELECT*
@@ -263,7 +263,7 @@ FROM dblink('myconn','SELECT * FROM foo') AS t(a int, b text, c text[])
263263
WHEREt.a>7;
264264

265265
-- create a named persistent connection
266-
SELECT dblink_connect('myconn','dbname=regression');
266+
SELECT dblink_connect('myconn','dbname=contrib_regression');
267267

268268
-- put more data into our slave table, using named persistent connection syntax
269269
-- but truncate the actual return value so we can use diff to check for success

‎src/Makefile.global.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.213 2005/03/25 23:22:53 momjian Exp $
2+
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.214 2005/05/17 18:26:22 tgl Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -228,6 +228,9 @@ XGETTEXT = @XGETTEXT@
228228
GZIP= gzip
229229
BZIP2= bzip2
230230

231+
PL_TESTDB = pl_regression
232+
CONTRIB_TESTDB = contrib_regression
233+
231234
# Installation.
232235

233236
INSTALL=$(SHELL)$(top_srcdir)/config/install-sh -c

‎src/makefiles/pgxs.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PGXS: PostgreSQL extensions makefile
22

3-
# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.3 2004/10/10 16:13:03 tgl Exp $
3+
# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.4 2005/05/17 18:26:22 tgl Exp $
44

55
# This file contains generic rules to build many kinds of simple
66
# extension modules. You only need to set a few variables and include
@@ -224,12 +224,12 @@ submake:
224224

225225
# against installed postmaster
226226
installcheck: submake
227-
$(top_builddir)/src/test/regress/pg_regress$(REGRESS)
227+
$(SHELL)$(top_builddir)/src/test/regress/pg_regress$(REGRESS_OPTS)$(REGRESS)
228228

229229
# in-tree test doesn't work yet (no way to install my shared library)
230230
#check: all submake
231-
#$(top_builddir)/src/test/regress/pg_regress --temp-install\
232-
# --top-builddir=$(top_builddir) $(REGRESS)
231+
#$(SHELL) $(top_builddir)/src/test/regress/pg_regress --temp-install\
232+
# --top-builddir=$(top_builddir) $(REGRESS_OPTS) $(REGRESS)
233233
check:
234234
@echo"'make check' is not supported."
235235
@echo"Do 'make install', then 'make installcheck' instead."

‎src/pl/plperl/GNUmakefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Makefile for PL/Perl
2-
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.19 2005/05/14 17:55:20 tgl Exp $
2+
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.20 2005/05/17 18:26:22 tgl Exp $
33

44
subdir = src/pl/plperl
55
top_builddir = ../../..
@@ -36,6 +36,7 @@ OBJS = plperl.o spi_internal.o SPI.o
3636

3737
SHLIB_LINK =$(perl_embed_ldflags)$(BE_DLLLIBS)
3838

39+
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plperl
3940
REGRESS = plperl
4041

4142
include$(top_srcdir)/src/Makefile.shlib
@@ -62,7 +63,7 @@ uninstall:
6263
rm -f$(DESTDIR)$(pkglibdir)/plperl$(DLSUFFIX)
6364

6465
installcheck: submake
65-
$(SHELL)$(top_builddir)/src/test/regress/pg_regress--load-language=plperl$(REGRESS)
66+
$(SHELL)$(top_builddir)/src/test/regress/pg_regress$(REGRESS_OPTS)$(REGRESS)
6667

6768
.PHONY: submake
6869
submake:

‎src/pl/plpython/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.19 2005/05/14 17:55:21 tgl Exp $
1+
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.20 2005/05/17 18:26:23 tgl Exp $
22

33
subdir = src/pl/plpython
44
top_builddir = ../../..
@@ -58,6 +58,7 @@ endif
5858

5959
SHLIB_LINK =$(BE_DLLLIBS)$(python_libspec)$(python_additional_libs)
6060

61+
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plpythonu
6162
REGRESS = plpython_schema plpython_populate plpython_function plpython_test plpython_error plpython_drop
6263

6364
include$(top_srcdir)/src/Makefile.shlib
@@ -81,7 +82,7 @@ uninstall:
8182
rm -f$(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)
8283

8384
installcheck: submake
84-
$(SHELL)$(top_builddir)/src/test/regress/pg_regress--load-language=plpythonu$(REGRESS)
85+
$(SHELL)$(top_builddir)/src/test/regress/pg_regress$(REGRESS_OPTS)$(REGRESS)
8586

8687
.PHONY: submake
8788
submake:

‎src/pl/tcl/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for the pltcl shared object
44
#
5-
# $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.45 2005/05/14 17:55:22 tgl Exp $
5+
# $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.46 2005/05/17 18:26:23 tgl Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -40,6 +40,7 @@ SO_MAJOR_VERSION = 2
4040
SO_MINOR_VERSION = 0
4141
OBJS = pltcl.o
4242

43+
REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=pltcl
4344
REGRESS = pltcl_setup pltcl_queries
4445

4546
include$(top_srcdir)/src/Makefile.shlib
@@ -68,7 +69,7 @@ uninstall:
6869
$(MAKE) -C modules$@
6970

7071
installcheck: submake
71-
$(SHELL)$(top_builddir)/src/test/regress/pg_regress--load-language=pltcl$(REGRESS)
72+
$(SHELL)$(top_builddir)/src/test/regress/pg_regress$(REGRESS_OPTS)$(REGRESS)
7273

7374
.PHONY: submake
7475
submake:

‎src/test/regress/pg_regress.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.54 2005/05/11 21:52:03 tgl Exp $
2+
# $PostgreSQL: pgsql/src/test/regress/pg_regress.sh,v 1.55 2005/05/17 18:26:23 tgl Exp $
33

44
me=`basename$0`
55
:${TMPDIR=/tmp}
@@ -11,6 +11,7 @@ PostgreSQL regression test driver
1111
Usage:$me [options...] [extra tests...]
1212
1313
Options:
14+
--dbname=DB use database DB (default\`regression')
1415
--debug turn on debug mode in programs that are run
1516
--inputdir=DIR take input files from DIR (default\`.')
1617
--load-language=lang load the named language before running the
@@ -123,6 +124,9 @@ do
123124
--version)
124125
echo"pg_regress (PostgreSQL @VERSION@)"
125126
exit 0;;
127+
--dbname=*)
128+
dbname=`expr"x$1":"x--dbname=\(.*\)"`
129+
shift;;
126130
--debug)
127131
debug=yes
128132
shift;;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp