Skip to content

Commit ed79edd

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 b6948e1 commit ed79edd

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
@@ -418,7 +418,7 @@ replace_string(char *string, char *replace, char *replacement)
418418
* the given suffix.
419419
*/
420420
static void
421-
convert_sourcefiles_in(char *source_subdir, char *dest_subdir, char *suffix)
421+
convert_sourcefiles_in(char *source_subdir, char *dest_dir, char *dest_subdir, char *suffix)
422422
{
423423
char testtablespace[MAXPGPATH];
424424
char indir[MAXPGPATH];
@@ -486,7 +486,8 @@ convert_sourcefiles_in(char *source_subdir, char *dest_subdir, char *suffix)
486486
/* build the full actual paths to open */
487487
snprintf(prefix, strlen(*name) - 6, "%s", *name);
488488
snprintf(srcfile, MAXPGPATH, "%s/%s", indir, *name);
489-
snprintf(destfile, MAXPGPATH, "%s/%s.%s", dest_subdir, prefix, suffix);
489+
snprintf(destfile, MAXPGPATH, "%s/%s/%s.%s", dest_dir, dest_subdir,
490+
prefix, suffix);
490491

491492
infile = fopen(srcfile, "r");
492493
if (!infile)
@@ -533,8 +534,8 @@ convert_sourcefiles_in(char *source_subdir, char *dest_subdir, char *suffix)
533534
static void
534535
convert_sourcefiles(void)
535536
{
536-
convert_sourcefiles_in("input", "sql", "sql");
537-
convert_sourcefiles_in("output", "expected", "out");
537+
convert_sourcefiles_in("input", inputdir, "sql", "sql");
538+
convert_sourcefiles_in("output", outputdir, "expected", "out");
538539
}
539540

540541
/*

0 commit comments

Comments
 (0)