#### the same line, the caller needs to add it. This avoids
#### differences due to a leading '*' binary file indicator, for
#### text files, on some platforms (Cygwin).
- @MD5SUM@ $* | @MD5FMT@ | cut -d ' ' -f 1
+ @MD5SUM@ $* | @MD5FMT@ | awk '{print $1}'
}
#### Use built-in $((...)) in test suite if shell supports it.
#### 'keep first'.
#### If different, global variable "failed" is incremented.
#### If there's an optional 'ignore space' argument, diff -b will
-#### be used instead of cmp to compare the files.
+#### be used instead of cmp to compare the files.
check() {
first=$1; shift
second=$1; shift
case $1 in
'keep first') keepfirst=1 ;;
'ignore space') ignorespace=1 ;;
- *) echo "$0: invalid check() argument \"$1\" in test suite" ;;
+ *) echo "$0: invalid check() argument \"$1\" in test suite" >&2 ;;
esac
shift
done
echo
echo "$0: test failed, outputs are in $first and $second."
failed=`expr ${failed:-0} + 1`
+ #### Set return status of the function.
+ [ $failed -eq 0 ]
fi
}