]> diplodocus.org Git - nmh/blobdiff - test/common.sh.in
Disable clang complaint about unused -ansi when linking by
[nmh] / test / common.sh.in
index 83578724a5093195f86746eee52b600de3ce0805..70214127f9ad1ae5d4be277cf089d852c11b6e7c 100644 (file)
@@ -35,7 +35,7 @@ output_md5()
   #### 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.
@@ -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
 }