aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2024-11-04 18:08:48 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2024-11-04 18:08:48 -0500
commit5e08ac63a26561bddbd8d400c623f33460c51bb8 (patch)
tree28ab306a12f9668d1b3f80dc1b0d8f73881a483c
parentf8f9110b4d33821ccb3e67454b3799448e2a325f (diff)
downloadpostgresql-5e08ac63a26561bddbd8d400c623f33460c51bb8.tar.gz
postgresql-5e08ac63a26561bddbd8d400c623f33460c51bb8.zip
Use portable diff options in pg_bsd_indent's regression test.
We had been using "diff -upd", which evidently works for most people, but Solaris's diff doesn't like it. (We'd not noticed because the Solaris buildfarm animals weren't running this test until they were upgraded to the latest buildfarm client script.) Change to "diff -U3" which is what pg_regress has used for ages. Per buildfarm (and off-list discussion with Noah Misch). Back-patch to v16 where this test was added. In v16, also back-patch the relevant part of 628c1d1f2 so that the test script looks about the same in all branches.
-rw-r--r--src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl b/src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl
index fef5c86ca47..cf5463f6807 100644
--- a/src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl
+++ b/src/tools/pg_bsd_indent/t/001_pg_bsd_indent.pl
@@ -26,6 +26,10 @@ program_version_ok('pg_bsd_indent');
# Any diffs in the generated files will be accumulated here.
my $diffs_file = "test.diffs";
+# options used with diff (see pg_regress.c's pretty_diff_opts)
+my @diffopts = ("-U3");
+push(@diffopts, "--strip-trailing-cr") if $windows_os;
+
# Copy support files to current dir, so *.pro files don't need to know path.
while (my $file = glob("$src_dir/tests/*.list"))
{
@@ -45,7 +49,7 @@ while (my $test_src = glob("$src_dir/tests/*.0"))
],
"pg_bsd_indent succeeds on $test");
# check result matches, adding any diff to $diffs_file
- my $result = run_log([ 'diff', '-upd', "$test_src.stdout", "$test.out" ],
+ my $result = run_log([ 'diff', @diffopts, "$test_src.stdout", "$test.out" ],
'>>', $diffs_file);
ok($result, "pg_bsd_indent output matches for $test");
}