Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

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ørgen Austvik, Software Engineering - QA
Sun Microsystems Database Group

Attachment: pg_regress-inputdir.patch
Description: text/x-patch (725 bytes)


pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group