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