Blame SOURCES/Makefile.regress

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