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