From: Peter Eisentraut Date: Wed, 2 Jan 2019 20:24:51 +0000 (+0100) Subject: Use standard diff separator for regression.diffs X-Git-Tag: REL_12_BETA1~737 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f27a14b1bd3d906144356ce19e33a2fd0095141;p=postgresql Use standard diff separator for regression.diffs Instead of ======..., use the standard separator for a multi-file diff, which is, per POSIX, "diff %s %s %s\n", , , This makes regression.diffs behave more like a proper diff file, for use with other tools. And it shows the diff options used, for clarity. Discussion: https://www.postgresql.org/message-id/70440c81-37bb-76dd-e48b-b5a9550d5613@2ndquadrant.com --- diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c index a4caa228e2..10111ebfb9 100644 --- a/src/test/regress/pg_regress.c +++ b/src/test/regress/pg_regress.c @@ -1454,20 +1454,23 @@ results_differ(const char *testname, const char *resultsfile, const char *defaul * Use the best comparison file to generate the "pretty" diff, which we * append to the diffs summary file. */ - snprintf(cmd, sizeof(cmd), - "diff %s \"%s\" \"%s\" >> \"%s\"", - pretty_diff_opts, best_expect_file, resultsfile, difffilename); - run_diff(cmd, difffilename); - /* And append a separator */ + /* Write diff header */ difffile = fopen(difffilename, "a"); if (difffile) { fprintf(difffile, - "\n======================================================================\n\n"); + "diff %s %s %s\n", + pretty_diff_opts, best_expect_file, resultsfile); fclose(difffile); } + /* Run diff */ + snprintf(cmd, sizeof(cmd), + "diff %s \"%s\" \"%s\" >> \"%s\"", + pretty_diff_opts, best_expect_file, resultsfile, difffilename); + run_diff(cmd, difffilename); + unlink(diff); return true; }