From: Denis Ovsienko Date: Tue, 4 Jan 2022 21:53:00 +0000 (+0000) Subject: Use unified diff by default. [skip ci] X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/be2af02dd563af4ab2b91f40fa415a3fe8eab8a1 Use unified diff by default. [skip ci] GNU/Linux (specifically, the GNU part), FreeBSD, NetBSD, OpenBSD, illumos and even Solaris 9 and AIX 7.1 all have a diff that supports "-u" for unified output format. Let that be the default to make test failures more intelligible for humans. The old behaviour is available with "DIFF_FLAGS= make check". --- diff --git a/CHANGES b/CHANGES index f0987a58..05ab4f35 100644 --- a/CHANGES +++ b/CHANGES @@ -22,6 +22,7 @@ Monthday, Month DD, YYYY by gharris and denis RPKI-Router: Refine length and bounds checks. Building and testing: Treat "msys" as Windows for test exit statuses. + Use unified diff by default. TBD Summary for 4.99.2 tcpdump release: (so far) diff --git a/tests/TESTrun b/tests/TESTrun index eddfacbc..cca46e63 100755 --- a/tests/TESTrun +++ b/tests/TESTrun @@ -39,6 +39,8 @@ mkpath($newdir); mkpath($diffdir); my $origdir = getcwd(); my $srcdir = $ENV{'srcdir'} || "."; +# Default to unified diff and allow to fall back to basic diff if necessary. +my $diff_flags = defined $ENV{'DIFF_FLAGS'} ? $ENV{'DIFF_FLAGS'} : '-u'; # # Force UTC, so time stamps are printed in a standard time zone, and @@ -226,7 +228,7 @@ sub runtest { $r = system "fc /lb1000 /t /1 $winoutput tests\\NEW\\$outputbase >tests\\DIFF\\$outputbase.diff"; $diffstat = $r >> 8; } else { - $r = system "diff $output tests/NEW/$outputbase >tests/DIFF/$outputbase.diff"; + $r = system "diff $diff_flags $output tests/NEW/$outputbase >tests/DIFF/$outputbase.diff"; $diffstat = WEXITSTATUS($r); } }