Commit 8f27a14b authored by Peter Eisentraut's avatar Peter Eisentraut

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", <diff_options>, <filename1>, <filename2>

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
parent 331a613e
...@@ -1454,20 +1454,23 @@ results_differ(const char *testname, const char *resultsfile, const char *defaul ...@@ -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 * Use the best comparison file to generate the "pretty" diff, which we
* append to the diffs summary file. * 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"); difffile = fopen(difffilename, "a");
if (difffile) if (difffile)
{ {
fprintf(difffile, fprintf(difffile,
"\n======================================================================\n\n"); "diff %s %s %s\n",
pretty_diff_opts, best_expect_file, resultsfile);
fclose(difffile); 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); unlink(diff);
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment