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