Skip to content

Commit f7b14e7

Browse files
committed
Honor inputdir and outputdir when converting regression files.
When converting source files, pg_regress' inputdir and outputdir options were ignored when computing the locations of the destination files. In consequence, these options were effectively unusable when the regression inputs need to be adjusted by pg_regress. This patch makes pg_regress put the converted files in the same place that these options specify non-converted input or results files are to be found. Backpatched to all live branches.
1 parent 97b767d commit f7b14e7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/test/regress/pg_regress.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ replace_string(char *string, char *replace, char *replacement)
403403
* the given suffix.
404404
*/
405405
static void
406-
convert_sourcefiles_in(char *source_subdir, char *dest_subdir, char *suffix)
406+
convert_sourcefiles_in(char *source_subdir, char *dest_dir, char *dest_subdir, char *suffix)
407407
{
408408
char testtablespace[MAXPGPATH];
409409
char indir[MAXPGPATH];
@@ -471,7 +471,8 @@ convert_sourcefiles_in(char *source_subdir, char *dest_subdir, char *suffix)
471471
/* build the full actual paths to open */
472472
snprintf(prefix, strlen(*name) - 6, "%s", *name);
473473
snprintf(srcfile, MAXPGPATH, "%s/%s", indir, *name);
474-
snprintf(destfile, MAXPGPATH, "%s/%s.%s", dest_subdir, prefix, suffix);
474+
snprintf(destfile, MAXPGPATH, "%s/%s/%s.%s", dest_dir, dest_subdir,
475+
prefix, suffix);
475476

476477
infile = fopen(srcfile, "r");
477478
if (!infile)
@@ -518,8 +519,8 @@ convert_sourcefiles_in(char *source_subdir, char *dest_subdir, char *suffix)
518519
static void
519520
convert_sourcefiles(void)
520521
{
521-
convert_sourcefiles_in("input", "sql", "sql");
522-
convert_sourcefiles_in("output", "expected", "out");
522+
convert_sourcefiles_in("input", inputdir, "sql", "sql");
523+
convert_sourcefiles_in("output", outputdir, "expected", "out");
523524
}
524525

525526
/*

0 commit comments

Comments
 (0)