test-init.sh: avoid failure on HP-UX 11.00
authorJim Meyering <meyering@redhat.com>
Thu, 5 Jan 2012 15:43:04 +0000 (16:43 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 5 Jan 2012 16:47:28 +0000 (17:47 +0100)
* tests/test-init.sh: Skip "diff -u"-comparing step when compare
resolves to diff -c or cmp.  Reported by Bruno Haible.

ChangeLog
tests/test-init.sh

index 9a4fd27..7f8998d 100644 (file)
--- 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'.
index ee1c798..1ed1b79 100755 (executable)
@@ -61,7 +61,11 @@ EOF
 +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
 }