blob: 2e249571841810dbf2ba92c52676528fe1f43a40 [file] [log] [blame]
#
# Makefile for isolation tests
#
PGFILEDESC = "pg_isolation_regress/isolationtester - multi-client test driver"
PGAPPICON = win32
subdir = src/test/isolation
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -I. -I$(srcdir) -I$(libpq_srcdir) \
-I$(srcdir)/../regress $(CPPFLAGS)
OBJS = \
$(WIN32RES) \
isolationtester.o \
specparse.o
all: isolationtester$(X) pg_isolation_regress$(X)
gpstringsubs.pl:
rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/gpstringsubs.pl
gpdiff.pl: atmsort.pm explain.pm GPTest.pm
rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/gpdiff.pl
GPTest.pm:
rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/GPTest.pm
atmsort.pm:
rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/atmsort.pm
explain.pm:
rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/explain.pm
# Though we don't install these binaries, build them during installation
# (including temp-install). Otherwise, "make -j check-world" and "make -j
# installcheck-world" would spawn multiple, concurrent builds in this
# directory. Later builds would overwrite files while earlier builds are
# reading them, causing occasional failures.
install: all installdirs
$(INSTALL_PROGRAM) pg_isolation_regress$(X) '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_isolation_regress$(X)'
$(INSTALL_PROGRAM) isolationtester$(X) '$(DESTDIR)$(pgxsdir)/$(subdir)/isolationtester$(X)'
installdirs:
$(MKDIR_P) '$(DESTDIR)$(pgxsdir)/$(subdir)'
uninstall:
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_isolation_regress$(X)'
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/isolationtester$(X)'
submake-regress:
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress.o
pg_regress.o: | submake-regress
rm -f $@ && $(LN_S) $(top_builddir)/src/test/regress/pg_regress.o .
pg_isolation_regress$(X): isolation_main.o pg_regress.o $(WIN32RES)
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@
isolationtester$(X): $(OBJS) | submake-libpq submake-libpgport
$(CC) $(CFLAGS) $^ $(libpq_pgport) $(LDFLAGS) $(rpath) $(LDFLAGS_EX) $(LIBS) -o $@
distprep: specparse.c specscanner.c
# specscanner is compiled as part of specparse
specparse.o: specscanner.c
# specparse.c and specscanner.c are in the distribution tarball,
# so do not clean them here
clean distclean:
rm -f isolationtester$(X) pg_isolation_regress$(X) $(OBJS) isolation_main.o
rm -f pg_regress.o
rm -f gpstringsubs.pl gpdiff.pl atmsort.pm explain.pm GPTest.pm
rm -rf $(pg_regress_clean_files)
maintainer-clean: distclean
rm -f specparse.c specscanner.c
# GPDB: pageinspect module is needed by some tests.
install-tests:
$(MAKE) -C $(top_builddir)/contrib/pageinspect install
# Unlike in most 'installcheck' tests, drop the database on success. The tests
# are run in utility mode, so the database is inconsistent between QD and the
# segments, and we don't want to leave that behind to confuse other tests.
installcheck: all gpdiff.pl gpstringsubs.pl install-tests
$(pg_isolation_regress_installcheck) --init-file=$(srcdir)/init_file --load-extension=pageinspect --schedule=$(srcdir)/isolation_schedule
$(bindir)/dropdb --if-exists isolation_regression
installcheck-singlenode: all gpdiff.pl gpstringsubs.pl install-tests
$(pg_isolation_regress_installcheck) --init-file=$(srcdir)/init_file --load-extension=pageinspect --schedule=$(srcdir)/isolation_schedule
$(bindir)/dropdb --if-exists isolation_regression
check: all
$(pg_isolation_regress_check) --schedule=$(srcdir)/isolation_schedule
# Non-default tests. It only makes sense to run these if set up to use
# prepared transactions, via TEMP_CONFIG for the check case, or via the
# postgresql.conf for the installcheck case.
installcheck-prepared-txns: all temp-install
$(pg_isolation_regress_installcheck) --schedule=$(srcdir)/isolation_schedule prepared-transactions prepared-transactions-cic
check-prepared-txns: all temp-install
$(pg_isolation_regress_check) --schedule=$(srcdir)/isolation_schedule prepared-transactions prepared-transactions-cic