Jim Meyering wrote: > * tests/test-exclude1.sh: Use init.sh. > * tests/test-exclude2.sh: Likewise. > * tests/test-exclude3.sh: Likewise. > * tests/test-exclude4.sh: Likewise. > * tests/test-exclude5.sh: Likewise. > * tests/test-exclude6.sh: Likewise. > * tests/test-exclude7.sh: Likewise. > * tests/test-exclude8.sh: Likewise. > * modules/exclude-tests (Files): List init.sh.
On AIX, HP-UX, Solaris, these tests now emit spurious output. AIX: There are no differences between the files. PASS: test-exclude1.sh SKIP: test-exclude2.sh There are no differences between the files. PASS: test-exclude3.sh There are no differences between the files. PASS: test-exclude4.sh SKIP: test-exclude5.sh There are no differences between the files. PASS: test-exclude6.sh There are no differences between the files. PASS: test-exclude7.sh There are no differences between the files. PASS: test-exclude8.sh HP-UX, Solaris: No differences encountered PASS: test-exclude1.sh SKIP: test-exclude2.sh No differences encountered PASS: test-exclude3.sh No differences encountered PASS: test-exclude4.sh SKIP: test-exclude5.sh No differences encountered PASS: test-exclude6.sh No differences encountered PASS: test-exclude7.sh No differences encountered PASS: test-exclude8.sh The Solaris 'diff' program understands option '-u', the AIX and HP-UX 'diff' programs don't. So here's a proposed patch. It removes the spurious output on all 3 platforms. 2011-11-12 Bruno Haible <br...@clisp.org> Silence successful tests that use 'compare' on AIX, HP-UX, Solaris. * tests/init.sh (compare): Remove "No differences encountered" or synonymous output from the 'diff' program. --- tests/init.sh.orig Sat Nov 12 21:10:28 2011 +++ tests/init.sh Sat Nov 12 21:10:27 2011 @@ -222,9 +222,34 @@ cleanup_ () { :; } if ( diff -u "$0" "$0" < /dev/null ) > /dev/null 2>&1; then - compare () { diff -u "$@"; } + compare () + { + if diff -u "$@" > diff.out; then + # No differences were found, but Solaris 'diff' produces output + # "No differences encountered". Hide this output. + rm -f diff.out + true + else + cat diff.out + rm -f diff.out + false + fi + } elif ( diff -c "$0" "$0" < /dev/null ) > /dev/null 2>&1; then - compare () { diff -c "$@"; } + compare () + { + if diff -c "$@" > diff.out; then + # No differences were found, but AIX and HP-UX 'diff' produce output + # "No differences encountered" or "There are no differences between the + # files.". Hide this output. + rm -f diff.out + true + else + cat diff.out + rm -f diff.out + false + fi + } elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then compare () { cmp -s "$@"; } else -- In memoriam Nicholas Owen <http://en.wikipedia.org/wiki/Nicholas_Owen_(martyr)>