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