Re: pg_regress in C - Mailing list pgsql-patches

From Tom Lane
Subject Re: pg_regress in C
Date
Msg-id 8373.1153277164@sss.pgh.pa.us
Whole thread Raw
In response to pg_regress in C  ("Magnus Hagander" <mha@sollentuna.net>)
Responses Re: [HACKERS] pg_regress in C
List pgsql-patches
"Magnus Hagander" <mha@sollentuna.net> writes:
> Per discussion at the conference:
> In order to run the regression tests on Windows without msys, pg_regress
> needs to be reimplemnted in C.

Patch committed after significant further work.  As committed,
pg_regress.c is pretty nearly an exact replacement for the shell script;
the only significant deviation is that the --temp_install switch's
argument is required not optional.  (This is because our homegrown
version of getopt_long doesn't allow optional arguments.  Maybe that
should be fixed sometime.)

There is one possibly important loose end: the shell script makes an
effort to catch signals and shut down the temp postmaster before
exiting, while there's no such code in the C version.  I'm not sure
if it's necessary.  At least on my machine, if you type control-C while
the tests are running then the kernel sends SIGINT to everything that's
part of the terminal's process group, which will include the postmaster
--- so the shutdown happens anyway.  I have no idea if that'll work on
Windows...  One reason I didn't try to do this is I'm a bit hesitant to
write a signal handler that does anything as interesting as a system()
call, which would seem to be necessary to duplicate what the shell
script did.  Comments?

            regards, tom lane

pgsql-patches by date:

Previous
From: Marc Munro
Date:
Subject: Re: New shared memory hooks proposal (was Re: pre_load_libraries)
Next
From: Tom Lane
Date:
Subject: Re: modular pg_regress.sh