Skip to content

Commit 8f27a14

Browse files
committed
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
1 parent 331a613 commit 8f27a14

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/test/regress/pg_regress.c

+9-6
Original file line numberDiff line numberDiff line change
@@ -1454,20 +1454,23 @@ results_differ(const char *testname, const char *resultsfile, const char *defaul
14541454
* Use the best comparison file to generate the "pretty" diff, which we
14551455
* append to the diffs summary file.
14561456
*/
1457-
snprintf(cmd, sizeof(cmd),
1458-
"diff %s \"%s\" \"%s\" >> \"%s\"",
1459-
pretty_diff_opts, best_expect_file, resultsfile, difffilename);
1460-
run_diff(cmd, difffilename);
14611457

1462-
/* And append a separator */
1458+
/* Write diff header */
14631459
difffile = fopen(difffilename, "a");
14641460
if (difffile)
14651461
{
14661462
fprintf(difffile,
1467-
"\n======================================================================\n\n");
1463+
"diff %s %s %s\n",
1464+
pretty_diff_opts, best_expect_file, resultsfile);
14681465
fclose(difffile);
14691466
}
14701467

1468+
/* Run diff */
1469+
snprintf(cmd, sizeof(cmd),
1470+
"diff %s \"%s\" \"%s\" >> \"%s\"",
1471+
pretty_diff_opts, best_expect_file, resultsfile, difffilename);
1472+
run_diff(cmd, difffilename);
1473+
14711474
unlink(diff);
14721475
return true;
14731476
}

0 commit comments

Comments
 (0)