From bdb55520b3ca4ca887497822aee7d399337228aa Mon Sep 17 00:00:00 2001 From: Lyndon Nerenberg Date: Thu, 31 Jan 2013 03:56:55 -0800 Subject: [PATCH] Use cmp(1) to compare acheieved and expected test results. 'diff -c' on Solaris 11 generate a spurious 'No differences encountered' message (on stdout, no less!) when the compared files are identical. This changes the test logic to compare with 'cmp -s', and then perform a 'diff -c' if the results don't match expectations. --- test/common.sh.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/common.sh.in b/test/common.sh.in index 3c916274..4c804155 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -128,10 +128,13 @@ check_for_hard_links () { #### If different, global variable "failed" is incremented. check() { #### POSIX diff should support -c. - if diff -c "$1" "$2"; then + if cmp -s "$1" "$2"; then test $# -lt 3 -o "$3" != 'keep first' && rm -f "$1" rm -f "$2" else + echo + diff -c "$1" "$2" + echo echo "$0: test failed, outputs are in $1 and $2." failed=`expr ${failed:-0} + 1` fi -- 2.56.0