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