changeset 16176:a6a6647d041e

init.sh: avoid unwarranted test failure when using "set -x" * tests/init.sh (compare): Ignore nonzero exit from compare_dev_null_. Otherwise, in a test script that uses "set -x" (like many in vc-dwim) a use like "compare exp out" would get evoke an unconditional failure.
author Jim Meyering <meyering@redhat.com>
date Thu, 22 Dec 2011 12:42:32 +0100
parents 5dd745d168ae
children dac34dbfc583
files ChangeLog tests/init.sh
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-12-22  Jim Meyering  <meyering@redhat.com>
+
+	init.sh: avoid unwarranted test failure when using "set -x"
+	* tests/init.sh (compare): Ignore nonzero exit from compare_dev_null_.
+	Otherwise, in a test script that uses "set -x" (like many in vc-dwim)
+	a use like "compare exp out" would get evoke an unconditional failure.
+
 2011-12-21  Alfred M. Szmidt  <ams@gnu.org>
 
 	bootstrap: fix it to honor $ACLOCAL_FLAGS once again
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -304,7 +304,7 @@
 # Otherwise, propagate $? to caller: any diffs have already been printed.
 compare ()
 {
-  compare_dev_null_ "$@"
+  compare_dev_null_ "$@" || :
   case $? in
     0|1) return $?;;
     *) compare_ "$@";;