diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2019-02-21 18:34:19 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2019-02-21 18:34:19 +0100 |
commit | 1995552deb5479a50ec9044f0179f906ff7772e0 (patch) | |
tree | e4800e179d41e5b9743d8ef791179197c0b5670c /src | |
parent | 1bb5e78218107db543086e71fc162d36a955b08e (diff) | |
download | postgresql-1995552deb5479a50ec9044f0179f906ff7772e0.tar.gz postgresql-1995552deb5479a50ec9044f0179f906ff7772e0.zip |
pg_regress: Don't use absolute paths for the diff
Don't expand inputfile and outputfile to absolute paths globally, just
where needed. In particular, pass them as is to the file name
arguments of the diff command, so that we don't see the full absolute
path in the diff header, which makes the diff unnecessarily verbose
and harder to read.
Discussion: https://www.postgresql.org/message-id/0cc82900-c457-1cee-3ab2-7b0f5d215061@2ndquadrant.com
Diffstat (limited to 'src')
-rw-r--r-- | src/test/regress/pg_regress.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index a18a6f6c45a..c28a78016b1 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -489,7 +489,7 @@ convert_sourcefiles_in(const char *source_subdir, const char *dest_dir, const ch /* Error logged in pgfnames */ exit(2); - snprintf(testtablespace, MAXPGPATH, "%s/testtablespace", outputdir); + snprintf(testtablespace, MAXPGPATH, "%s/testtablespace", make_absolute_path(outputdir)); #ifdef WIN32 @@ -553,10 +553,10 @@ convert_sourcefiles_in(const char *source_subdir, const char *dest_dir, const ch } while (fgets(line, sizeof(line), infile)) { - replace_string(line, "@abs_srcdir@", inputdir); - replace_string(line, "@abs_builddir@", outputdir); + replace_string(line, "@abs_srcdir@", make_absolute_path(inputdir)); + replace_string(line, "@abs_builddir@", make_absolute_path(outputdir)); replace_string(line, "@testtablespace@", testtablespace); - replace_string(line, "@libdir@", dlpath); + replace_string(line, "@libdir@", make_absolute_path(dlpath)); replace_string(line, "@DLSUFFIX@", DLSUFFIX); fputs(line, outfile); } @@ -2239,10 +2239,6 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc */ port = 0xC000 | (PG_VERSION_NUM & 0x3FFF); - inputdir = make_absolute_path(inputdir); - outputdir = make_absolute_path(outputdir); - dlpath = make_absolute_path(dlpath); - /* * Initialization */ @@ -2588,7 +2584,7 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc printf(_("The differences that caused some tests to fail can be viewed in the\n" "file \"%s\". A copy of the test summary that you see\n" "above is saved in the file \"%s\".\n\n"), - difffilename, logfilename); + make_absolute_path(difffilename), make_absolute_path(logfilename)); } else { |