8000 Honor inputdir and outputdir when converting regression files. · jandas/postgres@c0998cf · GitHub
[go: up one dir, main page]

Skip to content

Commit c0998cf

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 5d49250 commit c0998cf

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
@@ -413,7 +413,7 @@ replace_string(char *string, char *replace, char *replacement)
413413
* the given suffix.
414414
*/
415415
static void
416-
convert_sourcefiles_in(char *source_subdir, char *dest_subdir, char *suffix)
416+
convert_sourcefiles_in(char *source_subdir, char *dest_dir, char *dest_subdir, char *suffix)
417417
{
418418
char testtablespace[MAXPGPATH];
419419
char indir[MAXPGPATH];
@@ -481,7 +481,8 @@ convert_sourcefiles_in(char *source_subdir, char *dest_subdir, char *suffix)
481481
/* build the full actual paths to open */
482482
snprintf(prefix, strlen(*name) - 6, "%s", *name);
483483
snprintf(srcfile, MAXPGPATH, "%s/%s", indir, *name);
484-
snprintf(destfile, MAXPGPATH, "%s/%s.%s", dest_subdir, prefix, suffix);
484+
snprintf(destfile, MAXPGPATH, "%s/%s/%s.%s", dest_dir, dest_subdir,
485+
prefix, suffix);
485486

486487
infile = fopen(srcfile, "r");
487488
if (!infile)
@@ -528,8 +529,8 @@ convert_sourcefiles_in(char *source_subdir, char *dest_subdir, char *suffix)
528529
static void
529530
convert_sourcefiles(void)
530531
{
531-
convert_sourcefiles_in("input", "sql", "sql");
532-
convert_sourcefiles_in("output", "expected", "out");
532+
convert_sourcefiles_in("input", inputdir, "sql", "sql");
533+
convert_sourcefiles_in("output", outputdir, "expected", "out");
533534
}
534535

535536
/*

0 commit comments

Comments
 (0)
0