d1d6c2
#
d1d6c2
# Simplified makefile for running the PostgreSQL regression tests
d1d6c2
# in an RPM installation
d1d6c2
#
d1d6c2
d1d6c2
# maximum simultaneous connections for parallel tests
d1d6c2
MAXCONNOPT =
d1d6c2
ifdef MAX_CONNECTIONS
d1d6c2
MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
d1d6c2
endif
d1d6c2
d1d6c2
# locale
d1d6c2
NOLOCALE =
d1d6c2
ifdef NO_LOCALE
d1d6c2
NOLOCALE += --no-locale
d1d6c2
endif
d1d6c2
d1d6c2
srcdir := .
d1d6c2
d1d6c2
REGRESS_OPTS += --dlpath=.
d1d6c2
d1d6c2
pg_regress_locale_flags = $(if $(ENCODING),--encoding=$(ENCODING)) $(NOLOCALE)
d1d6c2
d1d6c2
pg_regress_installcheck = ./pg_regress --inputdir=$(srcdir) --bindir=@bindir@ $(pg_regress_locale_flags)
d1d6c2
d1d6c2
# Test input and expected files.  These are created by pg_regress itself, so we
d1d6c2
# don't have a rule to create them.  We do need rules to clean them however.
d1d6c2
ifile_list := $(subst .source,, $(notdir $(wildcard $(srcdir)/input/*.source)))
d1d6c2
input_files  := $(foreach file, $(ifile_list), sql/$(file).sql)
d1d6c2
ofile_list := $(subst .source,, $(notdir $(wildcard $(srcdir)/output/*.source)))
d1d6c2
output_files := $(foreach file, $(ofile_list), expected/$(file).out)
d1d6c2
d1d6c2
abs_srcdir := $(shell pwd)
d1d6c2
abs_builddir := $(shell pwd)
d1d6c2
d1d6c2
check: installcheck-parallel
d1d6c2
d1d6c2
installcheck: cleandirs
d1d6c2
	$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/serial_schedule $(EXTRA_TESTS)
d1d6c2
d1d6c2
installcheck-parallel: cleandirs
d1d6c2
	$(pg_regress_installcheck) $(REGRESS_OPTS) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(EXTRA_TESTS)
d1d6c2
d1d6c2
# The tests command the server to write into testtablespace and results.
d1d6c2
# On a SELinux-enabled system this will fail unless we mark those directories
d1d6c2
# as writable by the server.
d1d6c2
cleandirs:
d1d6c2
	-rm -rf testtablespace results
d1d6c2
	mkdir testtablespace results
d1d6c2
	[ -x /usr/bin/chcon ] && /usr/bin/chcon -u system_u -r object_r -t postgresql_db_t testtablespace results
d1d6c2
d1d6c2
# old interfaces follow...
d1d6c2
d1d6c2
runcheck: check
d1d6c2
runtest: installcheck
d1d6c2
runtest-parallel: installcheck-parallel
d1d6c2
d1d6c2
d1d6c2
##
d1d6c2
## Clean up
d1d6c2
##
d1d6c2
d1d6c2
clean distclean maintainer-clean:
d1d6c2
	rm -f $(output_files) $(input_files)
d1d6c2
	rm -rf testtablespace
d1d6c2
	rm -rf results tmp_check log
d1d6c2
	rm -f regression.diffs regression.out regress.out run_check.out