From: Jim Meyering Date: Sat, 12 Nov 2011 15:48:09 +0000 (+0100) Subject: test-exclude2.sh, test-exclude5.sh: fail if test-exclude fails X-Git-Tag: v0.1~1446 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=e500079a186434daeba99a1ea115690715fd56eb;p=gnulib.git test-exclude2.sh, test-exclude5.sh: fail if test-exclude fails These shell scripts ignored failure of the binary test-exclude, so making the latter return 77 didn't cause them to be skipped. * tests/test-exclude5.sh: Exit with test-exclude's error status when that program fails. Revamp to use init.sh. * tests/test-exclude2.sh: Likewise. --- diff --git a/ChangeLog b/ChangeLog index 4a2956650..d265d7512 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2011-11-12 Jim Meyering + test-exclude2.sh, test-exclude5.sh: fail if test-exclude fails + These shell scripts ignored failure of the binary test-exclude, + so making the latter return 77 didn't cause them to be skipped. + * tests/test-exclude5.sh: Exit with test-exclude's error status + when that program fails. Revamp to use init.sh. + * tests/test-exclude2.sh: Likewise. + test-exclude: fix a typo * tests/test-exclude.c (main): Test for "leading_dir", not "leading-dir". diff --git a/tests/test-exclude2.sh b/tests/test-exclude2.sh index 701175439..b38bb7fdd 100755 --- a/tests/test-exclude2.sh +++ b/tests/test-exclude2.sh @@ -16,11 +16,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -TMP=excltmp.$$ -LIST=flist.$$ -ERR=0 +. "${srcdir=.}/init.sh"; path_prepend_ . -cat > $LIST < in < $TMP < expected < out \ + || exit $? + +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac + +# normalize output +LC_ALL=C tr -d "$cr" < out > k +mv k out + +compare expected out || fail=1 -rm -f $TMP $LIST -exit $ERR +Exit $fail diff --git a/tests/test-exclude5.sh b/tests/test-exclude5.sh index 7f95ea7f2..32579637c 100755 --- a/tests/test-exclude5.sh +++ b/tests/test-exclude5.sh @@ -16,28 +16,36 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -TMP=excltmp.$$ -LIST=flist.$$ -ERR=0 +. "${srcdir=.}/init.sh"; path_prepend_ . + +fail=0 # Test FNM_LEADING_DIR -cat > $LIST < in < $TMP < expected < out \ + || exit $? + +# Find out how to remove carriage returns from output. Solaris /usr/ucb/tr +# does not understand '\r'. +case $(echo r | tr -d '\r') in '') cr='\015';; *) cr='\r';; esac + +# normalize output +LC_ALL=C tr -d "$cr" < out > k +mv k out + +compare expected out || fail=1 -rm -f $TMP $LIST -exit $ERR +Exit $fail