Commit Graph

52 Commits

Author SHA1 Message Date
Tom Lane 1304f297a4 Remove PGINTERVALSTYLE from the set of special environment variables for
libpq.  As noted by Peter, adding this variable created a risk of unexpected
connection failures when talking to older server versions, and since it
doesn't do anything you can't do with PGOPTIONS, it doesn't seem really
necessary.  Removing it does occasion a few extra lines in pg_regress.c,
but saving a getenv() call per libpq connection attempt is perhaps worth
that anyway.
2008-11-25 19:30:42 +00:00
Peter Eisentraut 45fe3afc04 If pg_ctl stop fails, print an error message and exit (instead of going out
of our way to ignore the exit status).  If this ever really happens, worst
case you will not see the "score" at the bottom of the test run.
2008-11-25 11:49:35 +00:00
Magnus Hagander 284491ee71 Silence compiler warning about ignored return value. Our comment already
clearly stated that we are aware that we're ignoring it.
2008-11-20 15:03:39 +00:00
Tom Lane df7641e25a Add a new GUC variable called "IntervalStyle" that decouples interval output
from DateStyle, and create a new interval style that produces output matching
the SQL standard (at least for interval values that fall within the standard's
restrictions).  IntervalStyle is also used to resolve the conflict between the
standard and traditional Postgres rules for interpreting negative interval
input.

Ron Mayer
2008-11-09 00:28:35 +00:00
Peter Eisentraut feae7856af Allow pg_regress to be run outside the build tree. Look for input files
in both input and output dir, to handle vpath builds more simply.
2008-10-01 22:38:57 +00:00
Tom Lane 7e61edf2e7 Fix some message style guideline violations in pg_regress, as well as
some failures to expose messages for translation.
2008-08-05 05:16:08 +00:00
Tom Lane 3c93218aeb Fix copy-and-pasteo that's causing pg_regress to lie about which file it can't
read when the --temp-config argument is bad.  Noted while wondering why
buildfarm member dungbeetle is failing ... this isn't why, but it is why
the error report isn't very helpful ...
2008-08-03 05:12:38 +00:00
Tom Lane 55de145d1c Improve pg_regress so that it reports the fact if any test process
exits with nonzero status.  The Windows part of this is untested ...
2008-05-17 20:02:01 +00:00
Tom Lane c5f11f9d19 Fix a number of places that were making file-type tests infelicitously.
The places that did, eg,
	(statbuf.st_mode & S_IFMT) == S_IFDIR
were correct, but there is no good reason not to use S_ISDIR() instead,
especially when that's what the other 90% of our code does.  The places
that did, eg,
	(statbuf.st_mode & S_IFDIR)
were flat out *wrong* and would fail in various platform-specific ways,
eg a symlink could be mistaken for a regular file on most Unixen.

The actual impact of this is probably small, since the problem cases
seem to always involve symlinks or sockets, which are unlikely to be
found in the directories that PG code might be scanning.  But it's
clearly trouble waiting to happen, so patch all the way back anyway.
(There seem to be no occurrences of the mistake in 7.4.)
2008-03-31 01:31:43 +00:00
Magnus Hagander 9b8a93baa4 Use windows DACL fix for pg_regress as well.
Dave Page
2008-03-04 15:38:31 +00:00
Tom Lane 8dd6c4b4be Make pg_regress -V consistent with the corresponding code in other
programs: use puts with a compile-time-constant string.
2008-02-20 22:44:16 +00:00
Tom Lane f10589e5f7 Make pg_regress clean out the testtablespace directory only on Windows.
On other platforms it's better to let the Makefile handle it, but we want
the regression tests to be invokable without make on Windows.  A batch
file would be a better solution, but no time for that before 8.3.
Per my discovery that this breaks testing under SELinux, and subsequent
discussion.
2008-01-19 17:43:42 +00:00
Bruce Momjian 9098ab9e32 Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
Tom Lane 42fd80de53 Fix pg_regress to check the directory it is actually reading files from,
not the image that (theoretically) should exist in the current directory.

Jørgen Austvik
2007-11-27 19:13:30 +00:00
Bruce Momjian fdf5a5efb7 pgindent run for 8.3. 2007-11-15 21:14:46 +00:00
Andrew Dunstan 0cb74d3cec Provide for a file specifying non-standard config options for temp install
for pg_regress, via --temp-config option. Pick this up in the make file
via TEMP_CONFIG setting.
2007-09-09 20:40:54 +00:00
Alvaro Herrera cdedfe6af1 Cast NULL to a pointer type in the execl() call, to avoid a compiler warning on
some platforms and possibly a bug.  Per report from Stefan and subsequent
discussion.
2007-07-18 21:19:17 +00:00
Magnus Hagander a0de6e7b97 Specifying a dbname should override the default database, not add to it.
Fixes buildfarm failures on contribcheck.
2007-06-12 13:54:58 +00:00
Magnus Hagander 8c0d308818 Fix missing variable initialization. 2007-06-12 13:26:45 +00:00
Magnus Hagander 09922597c5 Rewrite ECPG regression test driver in C, by splitting the standard
regression driver into two parts and reusing half of it. Required to
run ECPG tests without a shell on MSVC builds.

Fix ECPG thread tests for MSVC build (incl output files).

Joachim Wieland and Magnus Hagander
2007-06-12 11:07:34 +00:00
Peter Eisentraut 7ce9b3683e Make some messages more consistent 2007-05-31 15:13:06 +00:00
Tom Lane 4a30da1e7f Add missing #define for mingw, per Magnus. 2007-02-08 19:48:28 +00:00
Bruce Momjian 6fea31b693 Win32 regression test fixes:
For win32 in general, this makes it possible to run the regression tests
as an admin user by using the same restricted token method that's used
by pg_ctl and initdb.

For vc++, it adds building of pg_regress.exe, adds a resultmap, and
fixes how it runs the install.

Magnus Hagander
2007-02-08 15:28:58 +00:00
Peter Eisentraut 16059d39a0 Replace some strncpy() by strlcpy(). 2007-02-07 00:52:35 +00:00
Bruce Momjian 8b4ff8b6a1 Wording cleanup for error messages. Also change can't -> cannot.
Standard English uses "may", "can", and "might" in different ways:

        may - permission, "You may borrow my rake."

        can - ability, "I can lift that log."

        might - possibility, "It might rain today."

Unfortunately, in conversational English, their use is often mixed, as
in, "You may use this variable to do X", when in fact, "can" is a better
choice.  Similarly, "It may crash" is better stated, "It might crash".
2007-02-01 19:10:30 +00:00
Alvaro Herrera 67a4c24bc8 Fix pg_regress breakage for PL and contrib tests, by not requiring that
"input" and "output" dirs be necessarily present.
2007-01-19 21:21:13 +00:00
Alvaro Herrera 5b4a08896b Change the sed rules in the regression test for pg_regress hackery to create
the generated files, to help Visual C++ to run these tests.  The tests still
pass in VPATH and normal builds.

Patch from Magnus Hagander, editorialized by me.
2007-01-19 16:42:24 +00:00
Bruce Momjian 29dccf5fe0 Update CVS HEAD for 2007 copyright. Back branches are typically not
back-stamped for this.
2007-01-05 22:20:05 +00:00
Andrew Dunstan 226e9fffc8 Call setrlimit if possible in pg_regress to allow core file generation, and provide a switch for similar behaviour in pg_ctl. 2007-01-05 16:17:55 +00:00
Bruce Momjian f99a569a2e pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
Tom Lane f375d5d6f9 Cause pg_regress to invoke the temporary postmaster as 'postgres' not
'postmaster', so as not to depend on the existence of the postmaster
symlink.  Also, implement postmaster-still-alive and postmaster-kill
operations for Windows, per Magnus.
2006-09-24 17:10:18 +00:00
Tom Lane 9b5e108ee9 Fix shared library creation to work properly on AIX. Albe Laurenz 2006-09-19 15:36:08 +00:00
Tom Lane fbc7f59bfe If test postmaster fails to start within 60 seconds, try to kill -9 it
so that it won't interfere with later trials.  Per recent buildfarm
experience.  Anyone know how to do this on Windows?
2006-08-13 20:39:07 +00:00
Bruce Momjian 9a4eaa9440 Remove extra argument to printf(). 2006-08-01 18:01:36 +00:00
Andrew Dunstan a3bae60813 have pg_regress fall back on testing with the canonical results file if an
alternative test is specified but none succeeds.
2006-08-01 14:56:29 +00:00
Bruce Momjian 1a271f0c71 Fix WIN32 wait() return value macros to be accurate, particularly
because they are used for testing the return value from system().
(WIN32 doesn't overlay the return code with other failure conditions
like Unix does, so they are just simple macros.)

Fix regression checks to properly handle diff failures on Win32 using
the new macros.
2006-07-30 01:45:21 +00:00
Tom Lane 8aab197840 Original coding of pg_regress.c made the results and log directories
with restrictive permissions, which was not the behavior of the shell
script and doesn't seem very desirable.  Use the umask setting instead.
2006-07-27 15:37:19 +00:00
Tom Lane d8b5c95ca8 Remove hard-wired lists of timezone abbreviations in favor of providing
configuration files that can be altered by a DBA.  The australian_timezones
GUC setting disappears, replaced by a timezone_abbreviations setting (set this
to 'Australia' to get the effect of australian_timezones).  The list of zone
names defined by default has undergone a bit of cleanup, too.  Documentation
still needs some work --- in particular, should we fix Table B-4, or just get
rid of it?  Joachim Wieland, with some editorializing by moi.
2006-07-25 03:51:23 +00:00
Andrew Dunstan 631ea61883 Use correct ifdef test for cygwin, namely __CYGWIN__ (note underscores). 2006-07-25 01:37:42 +00:00
Andrew Dunstan 20a733d0a0 Remove dubious and redundant (we think) setting of libdir in PATH for non temp-install case. 2006-07-24 01:50:22 +00:00
Andrew Dunstan b0dc1fbbc5 Add libdir to PATH for Cygwin as well as WIN32 - should fix buildfarm eel. 2006-07-22 14:05:20 +00:00
Tom Lane bc660c4237 Ah, I finally realize why Magnus wanted to add a --bindir option to
pg_regress: there's no other way to cope with testing a relocated
installation.  Seems better to call it --psqldir though, since the
only thing we need to find in that case is psql.  It'd be better if
we could use find_other_exec, but that's not happening unless we are
willing to install pg_regress alongside psql, which seems unlikely
to happen.
2006-07-21 00:24:04 +00:00
Tom Lane 11f6d2fcba As a stopgap to get the Windows buildfarm members running again, hot-wire
the check on diff's exit status to check for literally 0 or 1.  Someone
should look into why WIFEXITED/WEXITSTATUS don't work for this, but I've
spent more than enough time on it already.
2006-07-20 16:25:30 +00:00
Tom Lane 7da24bcbc1 Print out diff status code when we think there's a hard failure.
May help in debugging behavior on Windows.
2006-07-20 03:30:58 +00:00
Tom Lane c3104376f9 Suppress unused-variable compiler warning, per Andrew Dunstan. 2006-07-20 02:15:17 +00:00
Tom Lane 27a83103ea Fix pg_regress.c to report tests in a parallel group when they finish,
not when they're started.  This mimics a subtle point of the behavior
of the old shell script, and gives better feedback when watching the
tests.
2006-07-20 02:10:00 +00:00
Tom Lane 5652ea703b Make pg_regress.c get paths from pg_config_paths.h, instead of -D
switches passed from the Makefile.  This looks like it will fix
problem with virtual vs real paths under msys.
2006-07-20 01:16:57 +00:00
Tom Lane 60cfe25e68 Adjust spawn_process() to avoid unnecessary overhead processes: we can
just exec instead of creating a subprocess.  This reduces process usage
from four processes per parallel test to two.  I have no idea whether
a comparable optimization is possible or useful in the Windows port.
2006-07-19 17:02:59 +00:00
Tom Lane 5b8b137b16 Adjust pg_regress to print out the exact string given to system() when
'make install' or 'initdb' fails.  Also minor simplification of fgets()
usage --- fgets guarantees a trailing null anyway.
2006-07-19 16:23:17 +00:00
Tom Lane fe2c4e414a kill() is declared in <signal.h> per Single Unix Spec. 2006-07-19 05:21:57 +00:00