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

Commitfeae785

Browse files
committed
Allow pg_regress to be run outside the build tree. Look for input files
in both input and output dir, to handle vpath builds more simply.
1 parentdad4cb6 commitfeae785

File tree

12 files changed

+145
-227
lines changed

12 files changed

+145
-227
lines changed

‎src/makefiles/pgxs.mk

Lines changed: 1 addition & 18 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.12 2008/04/07 14:15:58 petere Exp $
3+
# $PostgreSQL: pgsql/src/makefiles/pgxs.mk,v 1.13 2008/10/01 22:38:56 petere 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
@@ -232,23 +232,6 @@ endif
232232
# where to find psql for running the tests
233233
PSQLDIR =$(bindir)
234234

235-
# When doing a VPATH build, must copy over the test .sql and .out
236-
# files so that the driver script can find them. We have to use an
237-
# absolute path for the targets, because otherwise make will try to
238-
# locate the missing files using VPATH, and will find them in
239-
# $(srcdir), but the point here is that we want to copy them from
240-
# $(srcdir) to the build directory.
241-
242-
ifdefVPATH
243-
abs_builddir :=$(shell pwd)
244-
test_files_src :=$(wildcard$(srcdir)/sql/*.sql)$(wildcard$(srcdir)/expected/*.out)$(wildcard$(srcdir)/data/*.data)
245-
test_files_build :=$(patsubst$(srcdir)/%,$(abs_builddir)/%,$(test_files_src))
246-
247-
all:$(test_files_build)
248-
$(test_files_build):$(abs_builddir)/%:$(srcdir)/%
249-
ln -s$<$@
250-
endif# VPATH
251-
252235
.PHONY: submake
253236
submake:
254237
ifndefPGXS

‎src/pl/plperl/GNUmakefile

Lines changed: 1 addition & 22 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.34 2008/04/07 14:15:58 petere Exp $
2+
# $PostgreSQL: pgsql/src/pl/plperl/GNUmakefile,v 1.35 2008/10/01 22:38:56 petere Exp $
33

44
subdir = src/pl/plperl
55
top_builddir = ../../..
@@ -50,27 +50,6 @@ all: all-lib
5050
SPI.c: SPI.xs
5151
$(PERL)$(perl_privlibexp)/ExtUtils/xsubpp -typemap$(perl_privlibexp)/ExtUtils/typemap$<>$@
5252

53-
# When doing a VPATH build, copy over the .sql and .out files so that the
54-
# test script can find them. See comments in src/test/regress/GNUmakefile.
55-
ifdefVPATH
56-
57-
ifneq ($(PORTNAME),win32)
58-
abs_srcdir :=$(shell cd$(srcdir) && pwd)
59-
abs_builddir :=$(shell pwd)
60-
else
61-
abs_srcdir :=$(shell cd$(srcdir) && pwd -W)
62-
abs_builddir :=$(shell pwd -W)
63-
endif
64-
65-
test_files_src :=$(wildcard$(srcdir)/sql/*.sql)$(wildcard$(srcdir)/expected/*.out)
66-
test_files_build :=$(patsubst$(srcdir)/%,$(abs_builddir)/%,$(test_files_src))
67-
68-
all:$(test_files_build)
69-
$(test_files_build):$(abs_builddir)/%:$(srcdir)/%
70-
ln -s$<$@
71-
72-
endif
73-
7453
install: all installdirs install-lib
7554

7655
installdirs: installdirs-lib

‎src/pl/plpython/Makefile

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.29 2008/04/07 14:15:58 petere Exp $
1+
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.30 2008/10/01 22:38:56 petere Exp $
22

33
subdir = src/pl/plpython
44
top_builddir = ../../..
@@ -66,27 +66,6 @@ include $(top_srcdir)/src/Makefile.shlib
6666

6767
all: all-lib
6868

69-
# When doing a VPATH build, copy over the .sql and .out files so that the
70-
# test script can find them. See comments in src/test/regress/GNUmakefile.
71-
ifdefVPATH
72-
73-
ifneq ($(PORTNAME),win32)
74-
abs_srcdir :=$(shell cd$(srcdir) && pwd)
75-
abs_builddir :=$(shell pwd)
76-
else
77-
abs_srcdir :=$(shell cd$(srcdir) && pwd -W)
78-
abs_builddir :=$(shell pwd -W)
79-
endif
80-
81-
test_files_src :=$(wildcard$(srcdir)/sql/*.sql)$(wildcard$(srcdir)/expected/*.out)
82-
test_files_build :=$(patsubst$(srcdir)/%,$(abs_builddir)/%,$(test_files_src))
83-
84-
all:$(test_files_build)
85-
$(test_files_build):$(abs_builddir)/%:$(srcdir)/%
86-
ln -s$<$@
87-
88-
endif
89-
9069
install: all installdirs install-lib
9170

9271
installdirs: installdirs-lib

‎src/pl/tcl/Makefile

Lines changed: 1 addition & 22 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.51 2008/04/07 14:15:58 petere Exp $
5+
# $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.52 2008/10/01 22:38:56 petere Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -49,27 +49,6 @@ ifeq ($(TCL_SHARED_BUILD), 1)
4949
all: all-lib
5050
$(MAKE) -C modules$@
5151

52-
# When doing a VPATH build, copy over the .sql and .out files so that the
53-
# test script can find them. See comments in src/test/regress/GNUmakefile.
54-
ifdefVPATH
55-
56-
ifneq ($(PORTNAME),win32)
57-
abs_srcdir :=$(shell cd$(srcdir) && pwd)
58-
abs_builddir :=$(shell pwd)
59-
else
60-
abs_srcdir :=$(shell cd$(srcdir) && pwd -W)
61-
abs_builddir :=$(shell pwd -W)
62-
endif
63-
64-
test_files_src :=$(wildcard$(srcdir)/sql/*.sql)$(wildcard$(srcdir)/expected/*.out)
65-
test_files_build :=$(patsubst$(srcdir)/%,$(abs_builddir)/%,$(test_files_src))
66-
67-
all:$(test_files_build)
68-
$(test_files_build):$(abs_builddir)/%:$(srcdir)/%
69-
ln -s$<$@
70-
71-
endif
72-
7352
install: all installdirs install-lib
7453
$(MAKE) -C modules$@
7554

‎src/test/regress/GNUmakefile

Lines changed: 33 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
77
# Portions Copyright (c) 1994, Regents of the University of California
88
#
9-
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.74 2008/05/30 00:04:32 tgl Exp $
9+
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.75 2008/10/01 22:38:57 petere Exp $
1010
#
1111
#-------------------------------------------------------------------------
1212

@@ -65,9 +65,12 @@ pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h
6565
$(top_builddir)/src/port/pg_config_paths.h:$(top_builddir)/src/Makefile.global
6666
$(MAKE) -C$(top_builddir)/src/port pg_config_paths.h
6767

68-
install:pg_regress$(X)
68+
install:all installdirs
6969
$(INSTALL_PROGRAM) pg_regress$(X)'$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
7070

71+
installdirs:
72+
$(mkinstalldirs)'$(DESTDIR)$(pgxsdir)/$(subdir)'
73+
7174
uninstall:
7275
rm -f'$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
7376

@@ -83,34 +86,28 @@ all: all-lib
8386

8487
# Test input and expected files. These are created by pg_regress itself, so we
8588
# don't have a rule to create them. We do need rules to clean them however.
86-
ifile_list :=$(subst .source,,$(notdir$(wildcard$(top_srcdir)/$(subdir)/input/*.source)))
87-
input_files :=$(foreach file,$(ifile_list), sql/$(file).sql)
88-
ofile_list :=$(subst .source,,$(notdir$(wildcard$(top_srcdir)/$(subdir)/output/*.source)))
89-
output_files :=$(foreach file,$(ofile_list), expected/$(file).out)
90-
91-
ifneq ($(PORTNAME),win32)
92-
abs_srcdir :=$(shell cd$(srcdir) && pwd)
93-
abs_builddir :=$(shell pwd)
94-
else
95-
abs_srcdir :=$(shell cd$(srcdir) && pwd -W)
96-
abs_builddir :=$(shell pwd -W)
97-
endif
89+
input_files =$(patsubst$(srcdir)/input/%.source,sql/%.sql,$(wildcard$(srcdir)/input/*.source))
90+
output_files :=$(patsubst$(srcdir)/output/%.source,expected/%.out,$(wildcard$(srcdir)/output/*.source))
9891

99-
# When doing a VPATH build, copy over the remaining .sql and .out
100-
# files so that the driver script can find them. We have to use an
101-
# absolute path for the targets, because otherwise make will try to
102-
# locate the missing files using VPATH, and will find them in
103-
# $(srcdir), but the point here is that we want to copy them from
104-
# $(srcdir) to the build directory.
10592

106-
ifdefVPATH
107-
remaining_files_src :=$(wildcard$(srcdir)/sql/*.sql)$(wildcard$(srcdir)/expected/*.out)$(srcdir)/resultmap
108-
remaining_files_build :=$(patsubst$(srcdir)/%,$(abs_builddir)/%,$(remaining_files_src))
93+
# not installed by default
10994

110-
all:$(remaining_files_build)
111-
$(remaining_files_build):$(abs_builddir)/%:$(srcdir)/%
112-
ln -s$<$@
113-
endif
95+
regress_data_files =\
96+
$(filter-out$(addprefix$(srcdir)/,$(output_files)),$(wildcard$(srcdir)/expected/*.out))\
97+
$(wildcard$(srcdir)/input/*.source)\
98+
$(wildcard$(srcdir)/output/*.source)\
99+
$(filter-out$(addprefix$(srcdir)/,$(input_files)),$(wildcard$(srcdir)/sql/*.sql))\
100+
$(wildcard$(srcdir)/data/*.data)\
101+
$(srcdir)/parallel_schedule$(srcdir)/serial_schedule$(srcdir)/resultmap
102+
103+
install-tests: all install install-lib installdirs-tests
104+
$(MAKE) -C$(top_builddir)/contrib/spi install
105+
forfilein$(regress_data_files);do \
106+
$(INSTALL_DATA)$$file'$(DESTDIR)$(pkglibdir)/regress/'$$file;\
107+
done
108+
109+
installdirs-tests: installdirs
110+
$(mkinstalldirs)$(patsubst$(srcdir)/%/,'$(DESTDIR)$(pkglibdir)/regress/%',$(sort$(dir$(regress_data_files))))
114111

115112

116113
# Get some extra C modules from contrib/spi...
@@ -144,14 +141,16 @@ tablespace-setup:
144141
## Run tests
145142
##
146143

144+
pg_regress_call = ./pg_regress --inputdir=$(srcdir) --dlpath=. --multibyte=$(MULTIBYTE) --load-language=plpgsql$(NOLOCALE)
145+
147146
check: all
148-
./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --srcdir=$(abs_srcdir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule--multibyte=$(MULTIBYTE) --load-language=plpgsql$(MAXCONNOPT)$(NOLOCALE)$(TEMP_CONF)
147+
$(pg_regress_call) --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule$(MAXCONNOPT)$(TEMP_CONF)
149148

150149
installcheck: all
151-
./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule --srcdir=$(abs_srcdir) --multibyte=$(MULTIBYTE) --load-language=plpgsql$(NOLOCALE)
150+
$(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule
152151

153152
installcheck-parallel: all
154-
./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/parallel_schedule--srcdir=$(abs_srcdir) --multibyte=$(MULTIBYTE) --load-language=plpgsql$(MAXCONNOPT)$(NOLOCALE)
153+
$(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/parallel_schedule$(MAXCONNOPT)
155154

156155

157156
# old interfaces follow...
@@ -161,10 +160,10 @@ runtest: installcheck
161160
runtest-parallel: installcheck-parallel
162161

163162
bigtest: all
164-
./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule --srcdir=$(abs_srcdir) --multibyte=$(MULTIBYTE) --load-language=plpgsql$(NOLOCALE) numeric_big
163+
$(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule numeric_big
165164

166165
bigcheck: all
167-
./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --srcdir=$(abs_srcdir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule--multibyte=$(MULTIBYTE) --load-language=plpgsql$(MAXCONNOPT)$(NOLOCALE) numeric_big
166+
$(pg_regress_call) --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule$(MAXCONNOPT) numeric_big
168167

169168

170169
##
@@ -173,15 +172,9 @@ bigcheck: all
173172

174173
cleandistcleanmaintainer-clean: clean-lib
175174
# things built by `all' target
176-
rm -f $(OBJS) refint$(DLSUFFIX) autoinc$(DLSUFFIX)
177-
rm -f $(output_files) $(input_files) pg_regress_main.o pg_regress.o pg_regress$(X)
175+
rm -f $(OBJS) refint$(DLSUFFIX) autoinc$(DLSUFFIX) pg_regress_main.o pg_regress.o pg_regress$(X)
178176
# things created by various check targets
177+
rm -f $(output_files) $(input_files)
179178
rm -rf testtablespace
180179
rm -rf results tmp_check log
181180
rm -f regression.diffs regression.out regress.out run_check.out
182-
ifeq ($(PORTNAME), cygwin)
183-
rm -f regress.def
184-
endif
185-
ifdefVPATH
186-
rm -f $(remaining_files_build)
187-
endif

‎src/test/regress/input/create_function_1.source

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,52 @@
44

55
CREATE FUNCTION widget_in(cstring)
66
RETURNS widget
7-
AS '@abs_builddir@/regress@DLSUFFIX@'
7+
AS '@libdir@/regress@DLSUFFIX@'
88
LANGUAGE C STRICT;
99

1010
CREATE FUNCTION widget_out(widget)
1111
RETURNS cstring
12-
AS '@abs_builddir@/regress@DLSUFFIX@'
12+
AS '@libdir@/regress@DLSUFFIX@'
1313
LANGUAGE C STRICT;
1414

1515
CREATE FUNCTION int44in(cstring)
1616
RETURNS city_budget
17-
AS '@abs_builddir@/regress@DLSUFFIX@'
17+
AS '@libdir@/regress@DLSUFFIX@'
1818
LANGUAGE C STRICT;
1919

2020
CREATE FUNCTION int44out(city_budget)
2121
RETURNS cstring
22-
AS '@abs_builddir@/regress@DLSUFFIX@'
22+
AS '@libdir@/regress@DLSUFFIX@'
2323
LANGUAGE C STRICT;
2424

2525
CREATE FUNCTION check_primary_key ()
2626
RETURNS trigger
27-
AS '@abs_builddir@/refint@DLSUFFIX@'
27+
AS '@libdir@/refint@DLSUFFIX@'
2828
LANGUAGE C;
2929

3030
CREATE FUNCTION check_foreign_key ()
3131
RETURNS trigger
32-
AS '@abs_builddir@/refint@DLSUFFIX@'
32+
AS '@libdir@/refint@DLSUFFIX@'
3333
LANGUAGE C;
3434

3535
CREATE FUNCTION autoinc ()
3636
RETURNS trigger
37-
AS '@abs_builddir@/autoinc@DLSUFFIX@'
37+
AS '@libdir@/autoinc@DLSUFFIX@'
3838
LANGUAGE C;
3939

4040
CREATE FUNCTION funny_dup17 ()
4141
RETURNS trigger
42-
AS '@abs_builddir@/regress@DLSUFFIX@'
42+
AS '@libdir@/regress@DLSUFFIX@'
4343
LANGUAGE C;
4444

4545
CREATE FUNCTION ttdummy ()
4646
RETURNS trigger
47-
AS '@abs_builddir@/regress@DLSUFFIX@'
47+
AS '@libdir@/regress@DLSUFFIX@'
4848
LANGUAGE C;
4949

5050
CREATE FUNCTION set_ttdummy (int4)
5151
RETURNS int4
52-
AS '@abs_builddir@/regress@DLSUFFIX@'
52+
AS '@libdir@/regress@DLSUFFIX@'
5353
LANGUAGE C STRICT;
5454

5555
-- Things that shouldn't work:
@@ -73,7 +73,7 @@ CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C
7373
AS 'nosuchfile';
7474

7575
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE C
76-
AS '@abs_builddir@/regress@DLSUFFIX@', 'nosuchsymbol';
76+
AS '@libdir@/regress@DLSUFFIX@', 'nosuchsymbol';
7777

7878
CREATE FUNCTION test1 (int) RETURNS int LANGUAGE internal
7979
AS 'nosuch';

‎src/test/regress/input/create_function_2.source

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,36 +36,36 @@ CREATE FUNCTION user_relns()
3636

3737
CREATE FUNCTION pt_in_widget(point, widget)
3838
RETURNS bool
39-
AS '@abs_builddir@/regress@DLSUFFIX@'
39+
AS '@libdir@/regress@DLSUFFIX@'
4040
LANGUAGE C;
4141

4242
CREATE FUNCTION overpaid(emp)
4343
RETURNS bool
44-
AS '@abs_builddir@/regress@DLSUFFIX@'
44+
AS '@libdir@/regress@DLSUFFIX@'
4545
LANGUAGE C;
4646

4747
CREATE FUNCTION boxarea(box)
4848
RETURNS float8
49-
AS '@abs_builddir@/regress@DLSUFFIX@'
49+
AS '@libdir@/regress@DLSUFFIX@'
5050
LANGUAGE C;
5151

5252
CREATE FUNCTION interpt_pp(path, path)
5353
RETURNS point
54-
AS '@abs_builddir@/regress@DLSUFFIX@'
54+
AS '@libdir@/regress@DLSUFFIX@'
5555
LANGUAGE C;
5656

5757
CREATE FUNCTION reverse_name(name)
5858
RETURNS name
59-
AS '@abs_builddir@/regress@DLSUFFIX@'
59+
AS '@libdir@/regress@DLSUFFIX@'
6060
LANGUAGE C;
6161

6262
CREATE FUNCTION oldstyle_length(int4, text)
6363
RETURNS int4
64-
AS '@abs_builddir@/regress@DLSUFFIX@'
64+
AS '@libdir@/regress@DLSUFFIX@'
6565
LANGUAGE C;
6666

6767
--
6868
-- Function dynamic loading
6969
--
70-
LOAD '@abs_builddir@/regress@DLSUFFIX@';
70+
LOAD '@libdir@/regress@DLSUFFIX@';
7171

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp