diff options
author | Andres Freund <andres@anarazel.de> | 2022-08-20 10:59:01 -0700 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2022-08-20 10:59:01 -0700 |
commit | c855872074b5bf44ecea033674d22fac831cfc31 (patch) | |
tree | c78c8a77665ca88ec294b0a96b228601f1af657e /src/test | |
parent | 1509abe2c5da6002620718d18031f5b5234c15cd (diff) | |
download | postgresql-c855872074b5bf44ecea033674d22fac831cfc31.tar.gz postgresql-c855872074b5bf44ecea033674d22fac831cfc31.zip |
regress: allow to specify directory containing expected files, for ecpg
The ecpg tests have their input directory in the build directory, as the tests
need to be built. Until now that required copying the expected/ directory to
the build directory in VPATH builds. To avoid needing to implement the same
for the meson build, add support for specifying the location of the expected
directory.
Now that that's not needed anymore, remove the copying of ecpg's expected
directory to the build directory in VPATH builds.
Author: Nazir Bilal Yavuz <byavuz81@gmail.com>
Author: Andres Freund <andres@anarazel.de>
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Discussion: https://postgr.es/m/20220718202327.pspcqz5mwbi2yb7w@awork3.anarazel.de
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/regress/pg_regress.c | 7 | ||||
-rw-r--r-- | src/test/regress/pg_regress.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index 9ca1a8d9063..a803355f8ee 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -73,6 +73,7 @@ _stringlist *dblist = NULL; bool debug = false; char *inputdir = "."; char *outputdir = "."; +char *expecteddir = "."; char *bindir = PGBINDIR; char *launcher = NULL; static _stringlist *loadextension = NULL; @@ -1975,6 +1976,7 @@ help(void) printf(_(" --debug turn on debug mode in programs that are run\n")); printf(_(" --dlpath=DIR look for dynamic libraries in DIR\n")); printf(_(" --encoding=ENCODING use ENCODING as the encoding\n")); + printf(_(" --expecteddir=DIR take expected files from DIR (default \".\")\n")); printf(_(" -h, --help show this help, then exit\n")); printf(_(" --inputdir=DIR take input files from DIR (default \".\")\n")); printf(_(" --launcher=CMD use CMD as launcher of psql\n")); @@ -2038,6 +2040,7 @@ regression_main(int argc, char *argv[], {"load-extension", required_argument, NULL, 22}, {"config-auth", required_argument, NULL, 24}, {"max-concurrent-tests", required_argument, NULL, 25}, + {"expecteddir", required_argument, NULL, 26}, {NULL, 0, NULL, 0} }; @@ -2164,6 +2167,9 @@ regression_main(int argc, char *argv[], case 25: max_concurrent_tests = atoi(optarg); break; + case 26: + expecteddir = pg_strdup(optarg); + break; default: /* getopt_long already emitted a complaint */ fprintf(stderr, _("\nTry \"%s -h\" for more information.\n"), @@ -2203,6 +2209,7 @@ regression_main(int argc, char *argv[], inputdir = make_absolute_path(inputdir); outputdir = make_absolute_path(outputdir); + expecteddir = make_absolute_path(expecteddir); dlpath = make_absolute_path(dlpath); /* diff --git a/src/test/regress/pg_regress.h b/src/test/regress/pg_regress.h index 2143ee0e727..d8772fec8ed 100644 --- a/src/test/regress/pg_regress.h +++ b/src/test/regress/pg_regress.h @@ -53,6 +53,7 @@ extern _stringlist *dblist; extern bool debug; extern char *inputdir; extern char *outputdir; +extern char *expecteddir; extern char *launcher; extern const char *basic_diff_opts; |