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