diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile index 72b4371eb7..9e6488cff7 100644 --- a/src/interfaces/ecpg/test/Makefile +++ b/src/interfaces/ecpg/test/Makefile @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.62 2006/09/08 13:32:26 meskes Exp $ +# $PostgreSQL: pgsql/src/interfaces/ecpg/test/Makefile,v 1.63 2007/01/12 11:27:28 meskes Exp $ subdir = src/interfaces/ecpg/test top_builddir = ../../../.. @@ -25,6 +25,7 @@ endif all install installdirs uninstall dep depend distprep: $(MAKE) -C connect $@ + $(MAKE) -C expected $@ $(MAKE) -C sql $@ $(MAKE) -C pgtypeslib $@ $(MAKE) -C preproc $@ @@ -34,6 +35,7 @@ all install installdirs uninstall dep depend distprep: clean distclean maintainer-clean: $(MAKE) -C connect $@ $(MAKE) -C connect extraclean + $(MAKE) -C expected extraclean $(MAKE) -C sql $@ $(MAKE) -C pgtypeslib $@ $(MAKE) -C preproc $@ diff --git a/src/interfaces/ecpg/test/expected/Makefile b/src/interfaces/ecpg/test/expected/Makefile new file mode 100644 index 0000000000..2f8a4d833a --- /dev/null +++ b/src/interfaces/ecpg/test/expected/Makefile @@ -0,0 +1,18 @@ +subdir = src/interfaces/ecpg/test/expected +top_builddir = ../../../../.. +include $(top_builddir)/src/Makefile.global +include $(top_srcdir)/$(subdir)/../Makefile.regress + +# port number for temp-installation test postmaster +# this is also defined in ../Makefile +TEMP_PORT = 5$(DEF_PGPORT) + +connect-test1.c: connect-test1.c.in + sed -e 's,@TEMP_PORT@,$(TEMP_PORT),g' \ + $< >$@ + +all: connect-test1.c + +extraclean: + rm -f connect-test1.c + diff --git a/src/interfaces/ecpg/test/expected/connect-test1-minGW32.stderr b/src/interfaces/ecpg/test/expected/connect-test1-minGW32.stderr index 4930c27fd3..beabda36f2 100644 --- a/src/interfaces/ecpg/test/expected/connect-test1-minGW32.stderr +++ b/src/interfaces/ecpg/test/expected/connect-test1-minGW32.stderr @@ -1,6 +1,3 @@ - -THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT - [NO_PID]: ECPGdebug: set to 1 [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ECPGconnect: opening database connectdb on port @@ -19,45 +16,45 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: Connection main closed. [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432 +[NO_PID]: ECPGconnect: opening database connectdb on localhost port [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: Connection main closed. [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database on localhost port 55432 for user connectdb +[NO_PID]: ECPGconnect: opening database on localhost port for user connectdb [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: Connection main closed. [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database connectdb on port 55432 +[NO_PID]: ECPGconnect: opening database connectdb on port [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: Connection main closed. [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database on port 55432 for user connectdb +[NO_PID]: ECPGconnect: opening database on port for user connectdb [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: Connection main closed. [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432 for user connectuser +[NO_PID]: ECPGconnect: opening database connectdb on localhost port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: Connection connectdb closed. [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database on localhost port 55432 for user connectdb +[NO_PID]: ECPGconnect: opening database on localhost port for user connectdb [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: Connection closed. [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432 for user connectuser +[NO_PID]: ECPGconnect: opening database connectdb on localhost port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: Connection connectdb closed. [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database connectdb on port 55432 for user connectuser +[NO_PID]: ECPGconnect: opening database connectdb on port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: Connection connectdb closed. [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database connectdb on port 55432 for user connectuser +[NO_PID]: ECPGconnect: opening database connectdb on port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: ecpg_finish: Connection connectdb closed. [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: ECPGconnect: opening database nonexistant on localhost port 55432 for user connectuser +[NO_PID]: ECPGconnect: opening database nonexistant on localhost port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: connect: could not open database nonexistant on localhost port 55432 for user connectuser in line 62 +[NO_PID]: connect: could not open database nonexistant on localhost port for user connectuser in line 62 FATAL: database "nonexistant" does not exist [NO_PID]: sqlca: code: 0, state: 00000 @@ -67,9 +64,9 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT [NO_PID]: sqlca: code: -402, state: 08001 [NO_PID]: raising sqlcode -220 in line 63, 'No such connection CURRENT in line 63.'. [NO_PID]: sqlca: code: -220, state: 08003 -[NO_PID]: ECPGconnect: opening database connectdb on localhost port 20 for user connectuser +[NO_PID]: ECPGconnect: opening database connectdb on localhost port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 -[NO_PID]: connect: could not open database connectdb on localhost port 20 for user connectuser in line 66 +[NO_PID]: connect: could not open database connectdb on localhost port for user connectuser in line 66 could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" and accepting TCP/IP connections on port 20? @@ -79,5 +76,5 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT [NO_PID]: sqlca: code: 0, state: 00000 [NO_PID]: raising sqlcode -402 in line 66, 'Could not connect to database connectdb in line 66.'. [NO_PID]: sqlca: code: -402, state: 08001 -[NO_PID]: ECPGconnect: opening database connectdb on port 55432 for user connectuser +[NO_PID]: ECPGconnect: opening database connectdb on port for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 diff --git a/src/interfaces/ecpg/test/expected/connect-test1.c b/src/interfaces/ecpg/test/expected/connect-test1.c.in similarity index 69% rename from src/interfaces/ecpg/test/expected/connect-test1.c rename to src/interfaces/ecpg/test/expected/connect-test1.c.in index aee8e26f1b..f37475199e 100644 --- a/src/interfaces/ecpg/test/expected/connect-test1.c +++ b/src/interfaces/ecpg/test/expected/connect-test1.c.in @@ -61,42 +61,42 @@ main(void) #line 30 "test1.pgc" - { ECPGconnect(__LINE__, 0, "connectdb@localhost:55432" , NULL,NULL , "main", 0); } + { ECPGconnect(__LINE__, 0, "connectdb@localhost:@TEMP_PORT@" , NULL,NULL , "main", 0); } #line 32 "test1.pgc" { ECPGdisconnect(__LINE__, "main");} #line 33 "test1.pgc" - { ECPGconnect(__LINE__, 0, "@localhost:55432" , "connectdb" , NULL , "main", 0); } + { ECPGconnect(__LINE__, 0, "@localhost:@TEMP_PORT@" , "connectdb" , NULL , "main", 0); } #line 35 "test1.pgc" { ECPGdisconnect(__LINE__, "main");} #line 36 "test1.pgc" - { ECPGconnect(__LINE__, 0, "connectdb:55432" , NULL,NULL , "main", 0); } + { ECPGconnect(__LINE__, 0, "connectdb:@TEMP_PORT@" , NULL,NULL , "main", 0); } #line 38 "test1.pgc" { ECPGdisconnect(__LINE__, "main");} #line 39 "test1.pgc" - { ECPGconnect(__LINE__, 0, ":55432" , "connectdb" , NULL , "main", 0); } + { ECPGconnect(__LINE__, 0, ":@TEMP_PORT@" , "connectdb" , NULL , "main", 0); } #line 41 "test1.pgc" { ECPGdisconnect(__LINE__, "main");} #line 42 "test1.pgc" - { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/connectdb" , "connectuser" , "connectpw" , NULL, 0); } + { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:@TEMP_PORT@/connectdb" , "connectuser" , "connectpw" , NULL, 0); } #line 44 "test1.pgc" { ECPGdisconnect(__LINE__, "CURRENT");} #line 45 "test1.pgc" - { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/" , "connectdb" , NULL , NULL, 0); } + { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:@TEMP_PORT@/" , "connectdb" , NULL , NULL, 0); } #line 47 "test1.pgc" { ECPGdisconnect(__LINE__, "CURRENT");} @@ -104,7 +104,7 @@ main(void) strcpy(pw, "connectpw"); - strcpy(db, "tcp:postgresql://localhost:55432/connectdb"); + strcpy(db, "tcp:postgresql://localhost:@TEMP_PORT@/connectdb"); { ECPGconnect(__LINE__, 0, db , "connectuser" , pw , NULL, 0); } #line 52 "test1.pgc" @@ -112,14 +112,14 @@ main(void) #line 53 "test1.pgc" - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , "connectpw" , NULL, 0); } + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:@TEMP_PORT@/connectdb" , "connectuser" , "connectpw" , NULL, 0); } #line 55 "test1.pgc" { ECPGdisconnect(__LINE__, "CURRENT");} #line 56 "test1.pgc" - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , NULL , NULL, 0); } + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:@TEMP_PORT@/connectdb" , "connectuser" , NULL , NULL, 0); } #line 58 "test1.pgc" { ECPGdisconnect(__LINE__, "CURRENT");} @@ -127,7 +127,7 @@ main(void) /* wrong db */ - { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/nonexistant" , "connectuser" , "connectpw" , NULL, 0); } + { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:@TEMP_PORT@/nonexistant" , "connectuser" , "connectpw" , NULL, 0); } #line 62 "test1.pgc" { ECPGdisconnect(__LINE__, "CURRENT");} @@ -141,7 +141,7 @@ main(void) /* no disconnect necessary */ /* wrong password */ - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , "wrongpw" , NULL, 0); } + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:@TEMP_PORT@/connectdb" , "connectuser" , "wrongpw" , NULL, 0); } #line 70 "test1.pgc" /* no disconnect necessary */