X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/5322d1ddd3b63092a1566e18fddd13f619bd1cba..0cbc024a2a470a5b4f8cf56184ae2ff3a1b96e0c:/test/common.sh.in diff --git a/test/common.sh.in b/test/common.sh.in index 83578724..1d55dff5 100644 --- a/test/common.sh.in +++ b/test/common.sh.in @@ -133,7 +133,7 @@ check_for_hard_links () { #### '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 @@ -143,7 +143,7 @@ check() { 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 @@ -166,6 +166,8 @@ check() { 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 }