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