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
|
|
|
#
|
2007-01-05 23:20:05 +01:00
|
|
|
# Portions Copyright (c) 1996-2007, 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
|
|
|
#
|
2007-01-05 23:20:05 +01:00
|
|
|
# $PostgreSQL: pgsql/src/test/regress/GNUmakefile,v 1.63 2007/01/05 22:20:03 momjian 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
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
contribdir := $(top_builddir)/contrib
|
2000-01-09 08:54:00 +01:00
|
|
|
|
2005-07-17 20:28:45 +02:00
|
|
|
# port number for temp-installation test postmaster
|
|
|
|
TEMP_PORT = 5$(DEF_PGPORT)
|
|
|
|
|
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
|
|
|
|
MAXCONNOPT :=
|
|
|
|
ifdef MAX_CONNECTIONS
|
|
|
|
MAXCONNOPT += --max-connections=$(MAX_CONNECTIONS)
|
|
|
|
endif
|
|
|
|
|
2005-11-01 16:09:11 +01:00
|
|
|
# locale
|
|
|
|
NOLOCALE :=
|
|
|
|
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)"' \
|
|
|
|
'-DSHELLPROG="$(SHELL)"'
|
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)
|
|
|
|
|
|
|
|
pg_regress$(X): pg_regress.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
|
|
|
|
2006-07-19 04:37:00 +02:00
|
|
|
install: pg_regress$(X)
|
|
|
|
$(INSTALL_PROGRAM) pg_regress$(X) '$(DESTDIR)$(pgxsdir)/$(subdir)/pg_regress$(X)'
|
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
|
|
|
|
SO_MAJOR_VERSION= 0
|
|
|
|
SO_MINOR_VERSION= 0
|
2005-07-28 06:32:32 +02:00
|
|
|
OBJS = regress.o
|
2005-07-25 02:58:27 +02:00
|
|
|
SHLIB_LINK = $(BE_DLLLIBS)
|
|
|
|
|
|
|
|
include $(top_srcdir)/src/Makefile.shlib
|
|
|
|
|
|
|
|
all: $(NAME)$(DLSUFFIX)
|
|
|
|
|
|
|
|
$(NAME)$(DLSUFFIX): $(shlib)
|
|
|
|
rm -f $(NAME)$(DLSUFFIX)
|
|
|
|
$(LN_S) $(shlib) $(NAME)$(DLSUFFIX)
|
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
# Build test input and expected files
|
|
|
|
|
2004-06-18 08:14:31 +02:00
|
|
|
file_list := copy create_function_1 create_function_2 misc constraints tablespace
|
2000-09-29 19:17:41 +02:00
|
|
|
input_files := $(foreach file, $(file_list), sql/$(file).sql)
|
|
|
|
output_files := $(foreach file, $(file_list), expected/$(file).out)
|
|
|
|
|
|
|
|
all: $(input_files) $(output_files)
|
|
|
|
|
2004-03-03 05:22:47 +01:00
|
|
|
ifneq ($(PORTNAME),win32)
|
2000-10-27 22:00:22 +02:00
|
|
|
abs_srcdir := $(shell cd $(srcdir) && pwd)
|
|
|
|
abs_builddir := $(shell pwd)
|
2004-03-03 05:22:47 +01:00
|
|
|
else
|
|
|
|
abs_srcdir := $(shell cd $(srcdir) && pwd -W)
|
|
|
|
abs_builddir := $(shell pwd -W)
|
|
|
|
endif
|
|
|
|
|
2004-06-18 08:14:31 +02:00
|
|
|
testtablespace := $(abs_builddir)/testtablespace
|
|
|
|
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2000-10-27 22:00:22 +02:00
|
|
|
define sed-command
|
|
|
|
sed -e 's,@abs_srcdir@,$(abs_srcdir),g' \
|
|
|
|
-e 's,@abs_builddir@,$(abs_builddir),g' \
|
2004-06-18 08:14:31 +02:00
|
|
|
-e 's,@testtablespace@,$(testtablespace),g' \
|
2000-10-27 22:00:22 +02:00
|
|
|
-e 's/@DLSUFFIX@/$(DLSUFFIX)/g' $< >$@
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(input_files): sql/%.sql: input/%.source
|
|
|
|
$(sed-command)
|
|
|
|
|
|
|
|
$(output_files): expected/%.out: output/%.source
|
|
|
|
$(sed-command)
|
|
|
|
|
|
|
|
# When doing a VPATH build, copy over the remaining .sql and .out
|
|
|
|
# files so that the driver script can find them. We have to use an
|
|
|
|
# absolute path for the targets, because otherwise make will try to
|
|
|
|
# locate the missing files using VPATH, and will find them in
|
|
|
|
# $(srcdir), but the point here is that we want to copy them from
|
|
|
|
# $(srcdir) to the build directory.
|
|
|
|
|
|
|
|
ifdef VPATH
|
2002-01-08 22:00:30 +01:00
|
|
|
remaining_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out) $(srcdir)/resultmap
|
2000-10-27 22:00:22 +02:00
|
|
|
remaining_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(remaining_files_src))
|
|
|
|
|
|
|
|
all: $(remaining_files_build)
|
|
|
|
$(remaining_files_build): $(abs_builddir)/%: $(srcdir)/%
|
|
|
|
ln -s $< $@
|
|
|
|
endif
|
2000-09-29 19:17:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
# And finally some extra C modules...
|
|
|
|
|
|
|
|
all: all-spi
|
|
|
|
|
|
|
|
.PHONY: all-spi
|
|
|
|
all-spi:
|
2002-10-03 20:40:02 +02:00
|
|
|
$(MAKE) -C $(contribdir)/spi refint$(DLSUFFIX) autoinc$(DLSUFFIX)
|
2000-09-29 19:17:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
## Run tests
|
|
|
|
##
|
|
|
|
|
|
|
|
check: all
|
2004-06-18 08:14:31 +02:00
|
|
|
-rm -rf ./testtablespace
|
|
|
|
mkdir ./testtablespace
|
2006-07-19 04:37:00 +02:00
|
|
|
./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE)
|
2000-09-29 19:17:41 +02:00
|
|
|
|
|
|
|
installcheck: all
|
2004-06-18 08:14:31 +02:00
|
|
|
-rm -rf ./testtablespace
|
|
|
|
mkdir ./testtablespace
|
2006-07-21 02:24:04 +02:00
|
|
|
./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE)
|
2000-09-29 19:17:41 +02:00
|
|
|
|
2004-11-17 19:05:06 +01:00
|
|
|
installcheck-parallel: all
|
|
|
|
-rm -rf ./testtablespace
|
|
|
|
mkdir ./testtablespace
|
2006-07-21 02:24:04 +02:00
|
|
|
./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE)
|
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
|
|
|
|
2000-11-22 14:16:24 +01:00
|
|
|
bigtest:
|
2006-07-21 02:24:04 +02:00
|
|
|
./pg_regress --psqldir=$(PSQLDIR) --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(NOLOCALE) numeric_big
|
1999-11-19 19:51:52 +01:00
|
|
|
|
2000-11-22 14:16:24 +01:00
|
|
|
bigcheck:
|
2006-07-19 04:37:00 +02:00
|
|
|
./pg_regress --temp-install=./tmp_check --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) --load-language=plpgsql $(MAXCONNOPT) $(NOLOCALE) 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
|
2005-07-28 06:32:32 +02:00
|
|
|
rm -f $(NAME)$(DLSUFFIX) $(OBJS)
|
2000-09-29 19:17:41 +02:00
|
|
|
$(MAKE) -C $(contribdir)/spi clean
|
2006-07-19 04:37:00 +02:00
|
|
|
rm -f $(output_files) $(input_files) pg_regress.o pg_regress$(X)
|
2000-09-29 19:17:41 +02:00
|
|
|
# things created by various check targets
|
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
|
2003-03-21 18:18:34 +01:00
|
|
|
ifeq ($(PORTNAME), cygwin)
|
1999-01-17 07:20:06 +01:00
|
|
|
rm -f regress.def
|
|
|
|
endif
|
2000-10-27 22:00:22 +02:00
|
|
|
ifdef VPATH
|
|
|
|
rm -f $(remaining_files_build)
|
|
|
|
endif
|