Skip to content

Commit 2fd7706

Browse files
committed
Allow make check in PL directories
Also add make check-world target, and refactor pg_regress invocation code in makefiles a bit.
1 parent 0d90dc1 commit 2fd7706

File tree

12 files changed

+55
-30
lines changed

12 files changed

+55
-30
lines changed

GNUmakefile.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ check: all
6060
check installcheck installcheck-parallel:
6161
$(MAKE) -C src/test $@
6262

63+
# TODO: add contrib
64+
$(call recurse,check-world,src/test src/pl src/interfaces/ecpg,check)
65+
6366
$(call recurse,installcheck-world,src/test src/pl src/interfaces/ecpg contrib,installcheck)
6467

6568
GNUmakefile: GNUmakefile.in $(top_builddir)/config.status
@@ -121,4 +124,4 @@ distcheck: dist
121124
rm -rf $(distdir) $(dummy)
122125
@echo "Distribution integrity checks out."
123126

124-
.PHONY: dist distdir distcheck docs install-docs world install-world installcheck-world
127+
.PHONY: dist distdir distcheck docs install-docs world check-world install-world installcheck-world

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# GNUmakefile won't exist yet, so we catch that case as well.
1212

1313

14-
all check install installdirs installcheck installcheck-parallel uninstall clean distclean maintainer-clean dist distcheck world install-world installcheck-world:
14+
all check install installdirs installcheck installcheck-parallel uninstall clean distclean maintainer-clean dist distcheck world check-world install-world installcheck-world:
1515
@if [ ! -f GNUmakefile ] ; then \
1616
echo "You need to run the 'configure' program first. See the file"; \
1717
echo "'INSTALL' for installation instructions." ; \

src/Makefile.global.in

+13-3
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,6 @@ XGETTEXT = @XGETTEXT@
285285
GZIP = gzip
286286
BZIP2 = bzip2
287287

288-
PL_TESTDB = pl_regression
289-
CONTRIB_TESTDB = contrib_regression
290-
291288
# Installation.
292289

293290
INSTALL = $(SHELL) $(top_srcdir)/config/install-sh -c
@@ -426,6 +423,19 @@ submake-libpgport:
426423
.PHONY: submake-libpq submake-libpgport
427424

428425

426+
##########################################################################
427+
#
428+
# Testing support
429+
430+
PL_TESTDB = pl_regression
431+
CONTRIB_TESTDB = contrib_regression
432+
433+
pg_regress_check = $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --temp-install=./tmp_check --top-builddir=$(top_builddir)
434+
pg_regress_installcheck = $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir=$(PSQLDIR)
435+
436+
pg_regress_clean_files = results/ regression.diffs regression.out tmp_check/ log/
437+
438+
429439
##########################################################################
430440
#
431441
# Customization

src/makefiles/pgxs.mk

+3-5
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ ifdef EXTRA_CLEAN
231231
endif
232232
ifdef REGRESS
233233
# things created by various check targets
234-
rm -rf results tmp_check log
235-
rm -f regression.diffs regression.out regress.out run_check.out
234+
rm -rf $(pg_regress_clean_files)
236235
ifeq ($(PORTNAME), win)
237236
rm -f regress.def
238237
endif
@@ -280,12 +279,11 @@ endif
280279

281280
# against installed postmaster
282281
installcheck: submake
283-
$(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
282+
$(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
284283

285284
# in-tree test doesn't work yet (no way to install my shared library)
286285
#check: all submake
287-
# $(top_builddir)/src/test/regress/pg_regress --temp-install \
288-
# --top-builddir=$(top_builddir) $(REGRESS_OPTS) $(REGRESS)
286+
# $(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
289287
check:
290288
@echo "'make check' is not supported."
291289
@echo "Do 'make install', then 'make installcheck' instead."

src/pl/plperl/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44
/plperl_opmask.h
55

66
# Generated subdirectories
7+
/log/
78
/results/
9+
/tmp_check/

src/pl/plperl/GNUmakefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,19 @@ installdirs: installdirs-lib
7676

7777
uninstall: uninstall-lib
7878

79+
check: submake
80+
$(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
81+
7982
installcheck: submake
80-
$(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
83+
$(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
8184

8285
.PHONY: submake
8386
submake:
8487
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
8588

8689
clean distclean maintainer-clean: clean-lib
8790
rm -f SPI.c Util.c $(OBJS) perlchunks.h plperl_opmask.h
88-
rm -rf results
89-
rm -f regression.diffs regression.out
91+
rm -rf $(pg_regress_clean_files)
9092

9193
else # can't build
9294

src/pl/plpython/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Generated subdirectories
2+
/log/
23
/results/
4+
/tmp_check/

src/pl/plpython/Makefile

+9-4
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,19 @@ prep3:
120120
clean3:
121121
rm -rf python3/
122122

123+
check: submake prep3
124+
$(pg_regress_check) --inputdir=./python3 --outputdir=./python3 $(REGRESS_OPTS) $(REGRESS)
125+
123126
installcheck: submake prep3
124-
$(top_builddir)/src/test/regress/pg_regress --inputdir=./python3 --outputdir=./python3 --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
127+
$(pg_regress_installcheck) --inputdir=./python3 --outputdir=./python3 $(REGRESS_OPTS) $(REGRESS)
125128

126129
clean: clean3
127130
else
131+
check: submake
132+
$(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
133+
128134
installcheck: submake
129-
$(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
135+
$(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
130136
endif
131137

132138
.PHONY: submake
@@ -135,8 +141,7 @@ submake:
135141

136142
clean distclean maintainer-clean: clean-lib
137143
rm -f $(OBJS)
138-
rm -rf results
139-
rm -f regression.diffs regression.out
144+
rm -rf $(pg_regress_clean_files)
140145
ifeq ($(PORTNAME), win32)
141146
rm -f python${pytverstr}.def
142147
endif

src/pl/tcl/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Generated subdirectories
2+
/log/
23
/results/
4+
/tmp_check/

src/pl/tcl/Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ installdirs: installdirs-lib
5858
uninstall: uninstall-lib
5959
$(MAKE) -C modules $@
6060

61+
check: submake
62+
$(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
63+
6164
installcheck: submake
62-
$(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
65+
$(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
6366

6467
.PHONY: submake
6568
submake:
@@ -77,6 +80,5 @@ endif # TCL_SHARED_BUILD = 0
7780

7881
clean distclean maintainer-clean: clean-lib
7982
rm -f $(OBJS)
80-
rm -rf results
81-
rm -f regression.diffs regression.out
83+
rm -rf $(pg_regress_clean_files)
8284
$(MAKE) -C modules $@

src/test/regress/GNUmakefile

+8-9
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,19 @@ tablespace-setup:
138138
## Run tests
139139
##
140140

141-
pg_regress_call = ./pg_regress --inputdir=$(srcdir) --dlpath=. $(if $(MULTIBYTE),--multibyte=$(MULTIBYTE)) $(NOLOCALE)
141+
REGRESS_OPTS = --dlpath=. $(if $(MULTIBYTE),--multibyte=$(MULTIBYTE)) $(NOLOCALE)
142142

143143
check: all tablespace-setup
144-
$(pg_regress_call) --temp-install=./tmp_check --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(TEMP_CONF) $(EXTRA_TESTS)
144+
$(pg_regress_check) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(TEMP_CONF) $(EXTRA_TESTS)
145145

146146
installcheck: all tablespace-setup
147-
$(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule $(EXTRA_TESTS)
147+
$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/serial_schedule $(EXTRA_TESTS)
148148

149149
installcheck-parallel: all tablespace-setup
150-
$(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(EXTRA_TESTS)
150+
$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(EXTRA_TESTS)
151151

152152
standbycheck: all
153-
$(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/standby_schedule --use-existing
153+
$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/standby_schedule --use-existing
154154

155155
# old interfaces follow...
156156

@@ -159,10 +159,10 @@ runtest: installcheck
159159
runtest-parallel: installcheck-parallel
160160

161161
bigtest: all tablespace-setup
162-
$(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule numeric_big
162+
$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/serial_schedule numeric_big
163163

164164
bigcheck: all tablespace-setup
165-
$(pg_regress_call) --temp-install=./tmp_check --top-builddir=$(top_builddir) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) numeric_big
165+
$(pg_regress_check) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) numeric_big
166166

167167

168168
##
@@ -176,5 +176,4 @@ clean distclean maintainer-clean: clean-lib
176176
# things created by various check targets
177177
rm -f $(output_files) $(input_files)
178178
rm -rf testtablespace
179-
rm -rf results tmp_check log
180-
rm -f regression.diffs regression.out regress.out run_check.out
179+
rm -rf $(pg_regress_clean_files)

src/test/regress/pg_regress.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2094,7 +2094,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
20942094
/* "make install" */
20952095
#ifndef WIN32_ONLY_COMPILER
20962096
snprintf(buf, sizeof(buf),
2097-
SYSTEMQUOTE "\"%s\" -C \"%s\" DESTDIR=\"%s/install\" install with_perl=no with_python=no > \"%s/log/install.log\" 2>&1" SYSTEMQUOTE,
2097+
SYSTEMQUOTE "\"%s\" -C \"%s\" DESTDIR=\"%s/install\" install > \"%s/log/install.log\" 2>&1" SYSTEMQUOTE,
20982098
makeprog, top_builddir, temp_install, outputdir);
20992099
#else
21002100
snprintf(buf, sizeof(buf),

0 commit comments

Comments
 (0)