diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rwxr-xr-x | tests/misc/false | 28 |
2 files changed, 31 insertions, 0 deletions
@@ -2,11 +2,14 @@ * Version 5.0. + * tests/misc/Makefile.am (TESTS): Add false. + * Makefile.maint (TMPDIR): Make sure it's defined. (my-distcheck): Build in $(TMPDIR), not `.'. * src/Makefile.am (false.c): Change all occurrences of `(EXIT_SUCCESS)' to `(EXIT_FAILURE)'. Reported by Paul Jarc, + * tests/misc/false: New test for the above. 2003-03-30 Jim Meyering <jim@meyering.net> diff --git a/tests/misc/false b/tests/misc/false new file mode 100755 index 000000000..2d85bb56c --- /dev/null +++ b/tests/misc/false @@ -0,0 +1,28 @@ +#!/bin/sh +# ensure that false exits nonzero even with --help or --version + +if test "$VERBOSE" = yes; then + set -x + false --version +fi + +pwd=`pwd` +t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$ +trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0 +trap '(exit $?); exit $?' 1 2 13 15 + +framework_failure=0 +mkdir -p $tmp || framework_failure=1 +cd $tmp || framework_failure=1 + +if test $framework_failure = 1; then + echo "$0: failure in testing framework" 1>&2 + (exit 1); exit 1 +fi + +fail=0 + +false --version > /dev/null && fail=1 +false --help > /dev/null && fail=1 + +(exit $fail); exit $fail |