changeset 16227:57418c6cd32b

test-init.sh: avoid failure on HP-UX 11.00 * tests/test-init.sh: Skip "diff -u"-comparing step when compare resolves to diff -c or cmp. Reported by Bruno Haible.
author Jim Meyering <meyering@redhat.com>
date Thu, 05 Jan 2012 16:43:04 +0100
parents df2fa8e181f9
children 4adb73653ffa
files ChangeLog tests/test-init.sh
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-05  Jim Meyering  <meyering@redhat.com>
+
+	test-init.sh: avoid failure on HP-UX 11.00
+	* tests/test-init.sh: Skip "diff -u"-comparing step when compare
+	resolves to diff -c or cmp.  Reported by Bruno Haible.
+
 2012-01-05  Bruno Haible  <bruno@clisp.org>
 
 	Tests for module 'strtoull'.
--- a/tests/test-init.sh
+++ b/tests/test-init.sh
@@ -61,7 +61,11 @@
 +xyz
 EOF
   sed 's/	.*//;/^@@/d' out > k && mv k out
-  compare exp out || fail=1
+
+  # Check the expected output only if compare is using diff -u.
+  if $(exec 2>/dev/null; diff -u out out < /dev/null); then
+    compare exp out || fail=1
+  fi
   case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
 }