Copy refint.so and autoinc.so into the src/test/regress directory during
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 May 2008 00:04:32 +0000 (00:04 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 30 May 2008 00:04:32 +0000 (00:04 +0000)
"make all", and then reference them there during the actual tests.  This
makes the handling of these files more parallel to that of regress.so,
and in particular simplifies use of the regression tests outside the
original build tree.  The PGDG and Red Hat RPMs have been doing this via
patches for a very long time.  Inclusion of the change in core was requested
by Jørgen Austvik of Sun, and I can't see any reason not to.

I attempted to fix the MSVC scripts for this too, but they may need
further tweaking ...

doc/src/sgml/regress.sgml
src/test/regress/GNUmakefile
src/test/regress/input/create_function_1.source
src/test/regress/output/create_function_1.source
src/tools/msvc/clean.bat
src/tools/msvc/vcregress.pl

index f0588c6d9f838fe506d3c644a09d0ed6a35c23bc..10d81b21e623531544bc22f51c45ec83de3edf87 100644 (file)
@@ -48,9 +48,9 @@ gmake check
    script.  At the end you should see something like
 <screen>
 <computeroutput>
-======================
- All 100 tests passed.
-======================
+=======================
+ All 115 tests passed.
+=======================
 </computeroutput>
 </screen>
    or otherwise a note about which tests failed.  See <xref
@@ -67,7 +67,6 @@ gmake check
     For example
 <screen>
 <prompt>root# </prompt><userinput>chmod -R a+w src/test/regress</userinput>
-<prompt>root# </prompt><userinput>chmod -R a+w contrib/spi</userinput>
 <prompt>root# </prompt><userinput>su - joeuser</userinput>
 <prompt>joeuser$ </prompt><userinput>cd <replaceable>top-level build directory</></userinput>
 <prompt>joeuser$ </prompt><userinput>gmake check</userinput>
index 8581cdd934e8993bae1180e2620b4e88282cf82d..f86c34e67218357bcc7c86211a0acab83a75755b 100644 (file)
@@ -14,8 +14,6 @@ subdir = src/test/regress
 top_builddir = ../../..
 include $(top_builddir)/src/Makefile.global
 
-contribdir = $(top_builddir)/contrib
-
 # port number for temp-installation test postmaster
 TEMP_PORT = 5$(DEF_PGPORT)
 
@@ -115,20 +113,33 @@ $(remaining_files_build): $(abs_builddir)/%: $(srcdir)/%
 endif
 
 
-# And finally some extra C modules...
+# 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 $< $@
 
-all: all-spi tablespace-setup
+$(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)
 
-.PHONY: all-spi
-all-spi:
-       $(MAKE) -C $(contribdir)/spi refint$(DLSUFFIX) autoinc$(DLSUFFIX)
 
 # Tablespace setup
+
+all: tablespace-setup
+
 .PHONY: tablespace-setup
 tablespace-setup:
        rm -rf ./testtablespace
        mkdir ./testtablespace
 
+
 ##
 ## Run tests
 ##
@@ -162,8 +173,7 @@ bigcheck: all
 
 clean distclean maintainer-clean: clean-lib
 # things built by `all' target
-       rm -f $(OBJS)
-       $(MAKE) -C $(contribdir)/spi clean
+       rm -f $(OBJS) refint$(DLSUFFIX) autoinc$(DLSUFFIX)
        rm -f $(output_files) $(input_files) pg_regress_main.o pg_regress.o pg_regress$(X)
 # things created by various check targets
        rm -rf testtablespace
index fb357d93b07c4d8805d1ab2286a02e86d3f373af..15de37ca26324ad8f71cca69f36352a3533e2ecb 100644 (file)
@@ -24,17 +24,17 @@ CREATE FUNCTION int44out(city_budget)
 
 CREATE FUNCTION check_primary_key ()
        RETURNS trigger
-       AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
+       AS '@abs_builddir@/refint@DLSUFFIX@'
        LANGUAGE C;
 
 CREATE FUNCTION check_foreign_key ()
        RETURNS trigger
-       AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
+       AS '@abs_builddir@/refint@DLSUFFIX@'
        LANGUAGE C;
 
 CREATE FUNCTION autoinc ()
        RETURNS trigger
-       AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@'
+       AS '@abs_builddir@/autoinc@DLSUFFIX@'
        LANGUAGE C;
 
 CREATE FUNCTION funny_dup17 ()
index 1b309cf11a7815b5bb744c5fe8b1102e7413feb0..5c3779a2250a0b6c4747e3610776324d9a62e9f1 100644 (file)
@@ -25,15 +25,15 @@ CREATE FUNCTION int44out(city_budget)
 NOTICE:  argument type city_budget is only a shell
 CREATE FUNCTION check_primary_key ()
        RETURNS trigger
-       AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
+       AS '@abs_builddir@/refint@DLSUFFIX@'
        LANGUAGE C;
 CREATE FUNCTION check_foreign_key ()
        RETURNS trigger
-       AS '@abs_builddir@/../../../contrib/spi/refint@DLSUFFIX@'
+       AS '@abs_builddir@/refint@DLSUFFIX@'
        LANGUAGE C;
 CREATE FUNCTION autoinc ()
        RETURNS trigger
-       AS '@abs_builddir@/../../../contrib/spi/autoinc@DLSUFFIX@'
+       AS '@abs_builddir@/autoinc@DLSUFFIX@'
        LANGUAGE C;
 CREATE FUNCTION funny_dup17 ()
         RETURNS trigger
index 353404e61d830174930f558a8463796a33aa9ead..0bb914cf65e066c1fc38d3f4bc4329e5ffe27408 100755 (executable)
@@ -65,6 +65,8 @@ if exist src\test\regress\tmp_check rd /s /q src\test\regress\tmp_check
 if exist contrib\spi\refint.dll del /q contrib\spi\refint.dll
 if exist contrib\spi\autoinc.dll del /q contrib\spi\autoinc.dll
 if exist src\test\regress\regress.dll del /q src\test\regress\regress.dll
+if exist src\test\regress\refint.dll del /q src\test\regress\refint.dll
+if exist src\test\regress\autoinc.dll del /q src\test\regress\autoinc.dll
 
 REM Clean up datafiles built with contrib
 REM cd contrib
index c80b0816befb7186ffe74830e42c2928ef9f9ee0..d6aa2ff0e34e82129bdd8e986b4cabd7fc7ca076 100644 (file)
@@ -36,8 +36,8 @@ else
 # use a capital C here because config.pl has $config
 my $Config = -e "release/postgres/postgres.exe" ? "Release" : "Debug";
 
-copy("$Config/refint/refint.dll","contrib/spi");
-copy("$Config/autoinc/autoinc.dll","contrib/spi");
+copy("$Config/refint/refint.dll","src/test/regress");
+copy("$Config/autoinc/autoinc.dll","src/test/regress");
 copy("$Config/regress/regress.dll","src/test/regress");
 
 $ENV{PATH} = "../../../$Config/libpq;../../$Config/libpq;$ENV{PATH}";