Skip to content

Commit 2582fcc

Browse files
committed
tests: On HP-UX use "diff -c" by default. [skip ci]
HP-UX diff does not support the -u flag. Based on the feedback from Richard Lloyd of Connect Internet Solutions.
1 parent 3ebf2bd commit 2582fcc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ DayOfTheWeek, Month DD, YYYY / The Tcpdump Group
6464
CMake: Skip snprintf(3) tests when cross-compiling.
6565
Makefile.in: Do not install a version-suffixed tcpdump binary if the
6666
.devel file does not exists.
67+
tests: On HP-UX use "diff -c" by default.
6768
Documentation:
6869
man: Clarify the "any" pseudo-interface further.
6970

tests/TESTrun

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ mkpath($newdir);
3939
mkpath($diffdir);
4040
my $origdir = getcwd();
4141
my $srcdir = $ENV{'srcdir'} || ".";
42-
# Default to unified diff and allow to fall back to basic diff if necessary.
43-
my $diff_flags = defined $ENV{'DIFF_FLAGS'} ? $ENV{'DIFF_FLAGS'} : '-u';
42+
# Default to unified context diff (on HP-UX diff does not support it, so
43+
# default to the closest alternative) and allow to fall back to another diff
44+
# format if necessary.
45+
my $diff_flags = defined $ENV{'DIFF_FLAGS'} ? $ENV{'DIFF_FLAGS'} :
46+
$^O eq 'hpux' ? '-c' :
47+
'-u';
4448

4549
#
4650
# Force UTC, so time stamps are printed in a standard time zone, and

0 commit comments

Comments
 (0)