diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2012-03-17 17:30:52 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2012-03-17 17:30:52 -0400 |
commit | ed79eddba9367f1e35e480e87cbaafc18b9f75ca (patch) | |
tree | 1102a980388341405b5b0b0e122fb3c63a414c53 /src | |
parent | b6948e15464d7e86c0d892619d9c90c9cfd124f1 (diff) | |
download | postgresql-ed79eddba9367f1e35e480e87cbaafc18b9f75ca.tar.gz postgresql-ed79eddba9367f1e35e480e87cbaafc18b9f75ca.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/test/regress/pg_regress.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index 1c5c176e1f2..c8b45c93f20 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -418,7 +418,7 @@ replace_string(char *string, char *replace, char *replacement) * the given suffix. */ static void -convert_sourcefiles_in(char *source_subdir, char *dest_subdir, char *suffix) +convert_sourcefiles_in(char *source_subdir, char *dest_dir, char *dest_subdir, char *suffix) { char testtablespace[MAXPGPATH]; char indir[MAXPGPATH]; @@ -486,7 +486,8 @@ convert_sourcefiles_in(char *source_subdir, char *dest_subdir, char *suffix) /* build the full actual paths to open */ snprintf(prefix, strlen(*name) - 6, "%s", *name); snprintf(srcfile, MAXPGPATH, "%s/%s", indir, *name); - snprintf(destfile, MAXPGPATH, "%s/%s.%s", dest_subdir, prefix, suffix); + snprintf(destfile, MAXPGPATH, "%s/%s/%s.%s", dest_dir, dest_subdir, + prefix, suffix); infile = fopen(srcfile, "r"); if (!infile) @@ -533,8 +534,8 @@ convert_sourcefiles_in(char *source_subdir, char *dest_subdir, char *suffix) static void convert_sourcefiles(void) { - convert_sourcefiles_in("input", "sql", "sql"); - convert_sourcefiles_in("output", "expected", "out"); + convert_sourcefiles_in("input", inputdir, "sql", "sql"); + convert_sourcefiles_in("output", outputdir, "expected", "out"); } /* |