Blame SOURCES/Makefile.regress

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