1997-01-18 09:01:32 +01:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2000-01-09 08:54:00 +01:00
|
|
|
# GNUmakefile--
|
2005-07-25 02:58:27 +02:00
|
|
|
# Makefile for src/test/regress (the regression tests)
|
1997-01-18 09:01:32 +01:00
|
|
|
#
|
2008-01-01 20:46:01 +01:00
|
|
|
# Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
2005-07-25 02:58:27 +02:00
|
|
|
# Portions Copyright (c) 1994, Regents of the University of California
|
1997-01-18 09:01:32 +01:00
|
|
|
#
|
2008-10-02 00:38:57 +02:00
|
|
|
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.75 2008/10/01 22:38:57 petere Exp $
|
1997-01-18 09:01:32 +01:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2000-07-23 15:01:11 +02:00
|
|
|
subdir = src/test/regress
|
|
|
|
top_builddir = ../../..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
1997-01-18 09:01:32 +01:00
|
|
|
|
2005-07-17 20:28:45 +02:00
|
|
|
# port number for temp-installation test postmaster
|
|
|
|
TEMP_PORT = 5$(DEF_PGPORT)
|
|
|
|
|
2007-09-09 22:40:54 +02:00
|
|
|
# file with extra config for temp build
|
|
|
|
TEMP_CONF =
|
|
|
|
ifdef TEMP_CONFIG
|
2007-09-10 00:53:33 +02:00
|
|
|
TEMP_CONF += --temp-config=$(TEMP_CONFIG)
|
2007-09-09 22:40:54 +02:00
|
|
|
endif
|
|
|
|
|
2006-07-21 02:24:04 +02:00
|
|
|
# where to find psql for testing an existing installation
|
|
|
|
PSQLDIR = $(bindir)
|
|
|
|
|
2002-09-03 23:45:44 +02:00
|
|
|
# default encoding
|
|
|
|
MULTIBYTE = SQL_ASCII
|
|
|
|
|
2003-11-02 22:56:15 +01:00
|
|
|
# maximum simultaneous connections for parallel tests
|
2007-02-09 16:56:00 +01:00
|
|
|
MAXCONNOPT =
|
2003-11-02 22:56:15 +01:00
|
|
|
ifdef MAX_CONNECTIONS
|
|
|
|
MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
|
|
|
|
endif
|
|
|
|
|
2005-11-01 16:09:11 +01:00
|
|
|
# locale
|
2007-02-09 16:56:00 +01:00
|
|
|
NOLOCALE =
|
2005-11-01 16:09:11 +01:00
|
|
|
ifdef NO_LOCALE
|
|
|
|
NOLOCALE += --no-locale
|
|
|
|
endif
|
1997-04-12 11:34:31 +02:00
|
|
|
|
2006-07-19 04:37:00 +02:00
|
|
|
# stuff to pass into build of pg_regress
|
2006-07-20 03:16:57 +02:00
|
|
|
EXTRADEFS = '-DHOST_TUPLE="$(host_tuple)"' \
|
2006-07-19 19:02:59 +02:00
|
|
|
'-DMAKEPROG="$(MAKE)"' \
|
2007-01-19 17:42:24 +01:00
|
|
|
'-DSHELLPROG="$(SHELL)"' \
|
|
|
|
'-DDLSUFFIX="$(DLSUFFIX)"'
|
2006-07-19 04:37:00 +02:00
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
##
|
|
|
|
## Prepare for tests
|
|
|
|
##
|
|
|
|
|
|
|
|
# Build regression test driver
|
|
|
|
|
2006-07-19 04:37:00 +02:00
|
|
|
all: submake-libpgport pg_regress$(X)
|
|
|
|
|
2007-06-12 13:07:34 +02:00
|
|
|
pg_regress$(X): pg_regress.o pg_regress_main.o
|
2006-07-19 06:02:31 +02:00
|
|
|
$(CC) $(CFLAGS) $^ $(LDFLAGS) $(LIBS) -o $@
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2006-07-20 03:16:57 +02:00
|
|
|
# dependencies ensure that path changes propagate
|
|
|
|
pg_regress.o: pg_regress.c $(top_builddir)/src/port/pg_config_paths.h
|
|
|
|
$(CC) $(CFLAGS) $(CPPFLAGS) -I$(top_builddir)/src/port $(EXTRADEFS) -c -o $@ $<
|
|
|
|
|
|
|
|
$(top_builddir)/src/port/pg_config_paths.h: $(top_builddir)/src/Makefile.global
|
|
|
|
$(MAKE) -C $(top_builddir)/src/port pg_config_paths.h
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2008-10-02 00:38:57 +02:00
|
|
|
install: all installdirs
|
2006-07-19 04:37:00 +02:00
|
|
|
$(INSTALL_PROGRAM) pg_regress$(X) '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
|
2005-11-28 13:03:56 +01:00
|
|
|
|
2008-10-02 00:38:57 +02:00
|
|
|
installdirs:
|
|
|
|
$(mkinstalldirs) '$(DESTDIR)$(pgxsdir)/$(subdir)'
|
|
|
|
|
2005-11-28 13:03:56 +01:00
|
|
|
uninstall:
|
2006-07-19 04:37:00 +02:00
|
|
|
rm -f '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
|
2005-11-28 13:03:56 +01:00
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2006-02-27 17:09:50 +01:00
|
|
|
# Build dynamically-loaded object file for CREATE FUNCTION ... LANGUAGE C.
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2005-07-25 02:58:27 +02:00
|
|
|
NAME = regress
|
2005-07-28 06:32:32 +02:00
|
|
|
OBJS = regress.o
|
2005-07-25 02:58:27 +02:00
|
|
|
|
|
|
|
include $(top_srcdir)/src/Makefile.shlib
|
|
|
|
|
2008-04-07 16:15:58 +02:00
|
|
|
all: all-lib
|
2005-07-25 02:58:27 +02:00
|
|
|
|
2007-01-19 17:42:24 +01:00
|
|
|
# Test input and expected files. These are created by pg_regress itself, so we
|
|
|
|
# don't have a rule to create them. We do need rules to clean them however.
|
2008-10-02 00:38:57 +02:00
|
|
|
input_files = $(patsubst $(srcdir)/input/%.source,sql/%.sql, $(wildcard $(srcdir)/input/*.source))
|
|
|
|
output_files := $(patsubst $(srcdir)/output/%.source,expected/%.out, $(wildcard $(srcdir)/output/*.source))
|
2004-03-03 05:22:47 +01:00
|
|
|
|
2000-10-27 22:00:22 +02:00
|
|
|
|
2008-10-02 00:38:57 +02:00
|
|
|
# not installed by default
|
2000-10-27 22:00:22 +02:00
|
|
|
|
2008-10-02 00:38:57 +02:00
|
|
|
regress_data_files = \
|
|
|
|
$(filter-out $(addprefix $(srcdir)/,$(output_files)),$(wildcard $(srcdir)/expected/*.out)) \
|
|
|
|
$(wildcard $(srcdir)/input/*.source) \
|
|
|
|
$(wildcard $(srcdir)/output/*.source) \
|
|
|
|
$(filter-out $(addprefix $(srcdir)/,$(input_files)),$(wildcard $(srcdir)/sql/*.sql)) \
|
|
|
|
$(wildcard $(srcdir)/data/*.data) \
|
|
|
|
$(srcdir)/parallel_schedule $(srcdir)/serial_schedule $(srcdir)/resultmap
|
|
|
|
|
|
|
|
install-tests: all install install-lib installdirs-tests
|
|
|
|
$(MAKE) -C $(top_builddir)/contrib/spi install
|
|
|
|
for file in $(regress_data_files); do \
|
|
|
|
$(INSTALL_DATA) $$file '$(DESTDIR)$(pkglibdir)/regress/'$$file; \
|
|
|
|
done
|
|
|
|
|
|
|
|
installdirs-tests: installdirs
|
|
|
|
$(mkinstalldirs) $(patsubst $(srcdir)/%/,'$(DESTDIR)$(pkglibdir)/regress/%',$(sort $(dir $(regress_data_files))))
|
2000-09-29 19:17:41 +02:00
|
|
|
|
|
|
|
|
2008-05-30 02:04:32 +02:00
|
|
|
# Get some extra C modules from contrib/spi...
|
|
|
|
|
|
|
|
all: refint$(DLSUFFIX) autoinc$(DLSUFFIX)
|
|
|
|
|
|
|
|
refint$(DLSUFFIX): $(top_builddir)/contrib/spi/refint$(DLSUFFIX)
|
|
|
|
cp $< $@
|
|
|
|
|
|
|
|
autoinc$(DLSUFFIX): $(top_builddir)/contrib/spi/autoinc$(DLSUFFIX)
|
|
|
|
cp $< $@
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2008-05-30 02:04:32 +02:00
|
|
|
$(top_builddir)/contrib/spi/refint$(DLSUFFIX): $(top_srcdir)/contrib/spi/refint.c
|
|
|
|
$(MAKE) -C $(top_builddir)/contrib/spi refint$(DLSUFFIX)
|
|
|
|
|
|
|
|
$(top_builddir)/contrib/spi/autoinc$(DLSUFFIX): $(top_srcdir)/contrib/spi/autoinc.c
|
|
|
|
$(MAKE) -C $(top_builddir)/contrib/spi autoinc$(DLSUFFIX)
|
2000-09-29 19:17:41 +02:00
|
|
|
|
|
|
|
|
2007-01-31 20:38:50 +01:00
|
|
|
# Tablespace setup
|
2008-05-30 02:04:32 +02:00
|
|
|
|
|
|
|
all: tablespace-setup
|
|
|
|
|
2007-01-31 20:38:50 +01:00
|
|
|
.PHONY: tablespace-setup
|
|
|
|
tablespace-setup:
|
2008-03-18 17:24:50 +01:00
|
|
|
rm -rf ./testtablespace
|
2007-01-31 20:38:50 +01:00
|
|
|
mkdir ./testtablespace
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2008-05-30 02:04:32 +02:00
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
##
|
|
|
|
## Run tests
|
|
|
|
##
|
|
|
|
|
2008-10-02 00:38:57 +02:00
|
|
|
pg_regress_call = ./pg_regress --inputdir=$(srcdir) --dlpath=. --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE)
|
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
check: all
|
2008-10-02 00:38:57 +02:00
|
|
|
$(pg_regress_call) --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) $(TEMP_CONF)
|
2000-09-29 19:17:41 +02:00
|
|
|
|
|
|
|
installcheck: all
|
2008-10-02 00:38:57 +02:00
|
|
|
$(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2004-11-17 19:05:06 +01:00
|
|
|
installcheck-parallel: all
|
2008-10-02 00:38:57 +02:00
|
|
|
$(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT)
|
2004-11-17 19:05:06 +01:00
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
|
|
|
|
# old interfaces follow...
|
|
|
|
|
2000-11-22 14:16:24 +01:00
|
|
|
runcheck: check
|
|
|
|
runtest: installcheck
|
2004-11-17 19:05:06 +01:00
|
|
|
runtest-parallel: installcheck-parallel
|
1997-01-18 09:01:32 +01:00
|
|
|
|
2007-01-31 20:38:50 +01:00
|
|
|
bigtest: all
|
2008-10-02 00:38:57 +02:00
|
|
|
$(pg_regress_call) --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule numeric_big
|
1999-11-19 19:51:52 +01:00
|
|
|
|
2007-01-31 20:38:50 +01:00
|
|
|
bigcheck: all
|
2008-10-02 00:38:57 +02:00
|
|
|
$(pg_regress_call) --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule $(MAXCONNOPT) numeric_big
|
1999-11-19 19:51:52 +01:00
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2000-11-22 14:16:24 +01:00
|
|
|
##
|
|
|
|
## Clean up
|
|
|
|
##
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2005-07-25 02:58:27 +02:00
|
|
|
clean distclean maintainer-clean: clean-lib
|
2000-09-29 19:17:41 +02:00
|
|
|
# things built by `all' target
|
2008-10-02 00:38:57 +02:00
|
|
|
rm -f $(OBJS) refint$(DLSUFFIX) autoinc$(DLSUFFIX) pg_regress_main.o pg_regress.o pg_regress$(X)
|
2000-09-29 19:17:41 +02:00
|
|
|
# things created by various check targets
|
2008-10-02 00:38:57 +02:00
|
|
|
rm -f $(output_files) $(input_files)
|
2004-06-18 08:14:31 +02:00
|
|
|
rm -rf testtablespace
|
2002-07-02 07:43:34 +02:00
|
|
|
rm -rf results tmp_check log
|
2000-09-29 19:17:41 +02:00
|
|
|
rm -f regression.diffs regression.out regress.out run_check.out
|