pg_regress inputdir

From: Jorgen Austvik - Sun Norway <Jorgen(dot)Austvik(at)Sun(dot)COM>
To: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: pg_regress inputdir
Date: 2008-07-29 13:16:38
Message-ID: 488F1836.6040604@sun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

with regards to --inputdir, --srcdir, --outputdir and --schedule,
pg_regress does something like this:

convert files in <srcdir>/input, and place them in ./sql
convert files in <srcdir>/output, and place them in ./expected
read schedule from <schedule>
for each test in schedule:
read test from <inputdir>/sql/<testname>.sql
read expected result from <inputdir>/expected/<testname>.out
write results to <outputdir>/results/<testname>.out

My problem when running pg_regress standalone, is that converted files
are written to e.g. ./sql, but read from e.g. <inputdir>/sql, which
makes the --inputdir parameter pretty unusable if it is set to something
different from some path leading to cwd.

Illustrated with code:

Writing converted source file (pg_regress.s:493):
snprintf(destfile, MAXPGPATH, "%s/%s.%s", dest, prefix, suffix);

(Where dest is "sql" or "expected".)

Reading files (pg_regress_main.c:37+38):
snprintf(infile, sizeof(infile), "%s/sql/%s.sql", inputdir, testname);

The attached patch makes pg_regress write converted files to
<inputdir>/sql and <inputdir>/expected, which is one way to make it read
and write to the same directory. Tested on Solaris x86 with pgsql "make
check" and standalone.

-J
--

Jørgen Austvik, Software Engineering - QA
Sun Microsystems Database Group

http://blogs.sun.com/austvik/
http://www.austvik.net/

Attachment Content-Type Size
pg_regress-inputdir.patch text/x-patch 725 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zdenek Kotala 2008-07-29 13:26:43 Re: Python 2.5 vs the buildfarm
Previous Message Stephen Frost 2008-07-29 13:11:24 Re: patch: Add a separate TRUNCATE permission