Thread: partial pg_regress patch from Magnus

partial pg_regress patch from Magnus

From
Alvaro Herrera
Date:
Hi,

This is a revised partial version of Magnus' patch to pg_regress.  The
only thing this patch does is remove the dependency on sed, by having
pg_regress itself generate the .sql and .out files from the .source
files.

The motivator behind this patch is allowing the Visual C++ environment
be in the buildfarm, so while I personally think it's a dumb thing to do
;-) I think the end is worthwhile.

pg_regress now needs to have the source dir in a VPATH build, to know
where to find the source files to process.  So a new --srcdir switch was
added.

I tested it in a VPATH and a normal build, and regression test still
pass.  This is mostly Magnus' code: I merely stripped out the parts
unrelated to this change, and reworked the code a little.  So the
possible bugs are likely mine.

I also changed the Makefile so that the source file list is not
explicit, but rather a $(wildcard) thing.  This is because now
pg_regress also gets the file list using a wildcard sort of thing.  (The
file list is only used in the "clean" target, so it's likely to get
desynchronized if it has to be updated manually).

Magnus' original patch is in the queue:
http://momjian.us/mhonarc/patches/msg00000.html

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Attachment

Re: partial pg_regress patch from Magnus

From
Alvaro Herrera
Date:
Alvaro Herrera wrote:

> I tested it in a VPATH and a normal build, and regression test still
> pass.  This is mostly Magnus' code: I merely stripped out the parts
> unrelated to this change, and reworked the code a little.  So the
> possible bugs are likely mine.

Woops, it doesn't work in VPATH :-(  Sorry, I'll fix and resubmit.
(It only worked before because the parallel test had created the files,
and I failed to run "make clean" between runs).

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: partial pg_regress patch from Magnus

From
Alvaro Herrera
Date:
Alvaro Herrera wrote:
> Alvaro Herrera wrote:
>
> > I tested it in a VPATH and a normal build, and regression test still
> > pass.  This is mostly Magnus' code: I merely stripped out the parts
> > unrelated to this change, and reworked the code a little.  So the
> > possible bugs are likely mine.
>
> Woops, it doesn't work in VPATH :-(  Sorry, I'll fix and resubmit.
> (It only worked before because the parallel test had created the files,
> and I failed to run "make clean" between runs).

It seems the problem was only that the makefile was neglecting to add
the --srcdir argument.  It was kind of annoying that it didn't show any
warning or anything; I spent quite some time trying to figure out what
was going wrong.  I think I'll add a check that if it detects less than,
say, 5 files, throw an error message and quit.

Other than that, if I don't see objections, I'll commit it later today.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: partial pg_regress patch from Magnus

From
Alvaro Herrera
Date:
Alvaro Herrera wrote:

> Other than that, if I don't see objections, I'll commit it later today.

Applied.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: partial pg_regress patch from Magnus

From
Alvaro Herrera
Date:
Alvaro Herrera wrote:
> Alvaro Herrera wrote:
>
> > Other than that, if I don't see objections, I'll commit it later today.
>
> Applied.

And apparently I broke most of the buildfarm, sorry :-(  Working on it.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support