diff options
Diffstat (limited to 'tests/tail/tail-tests')
-rwxr-xr-x | tests/tail/tail-tests | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/tests/tail/tail-tests b/tests/tail/tail-tests new file mode 100755 index 000000000..6804eeaac --- /dev/null +++ b/tests/tail/tail-tests @@ -0,0 +1,103 @@ +#! /bin/sh +# This script was generated automatically by build-script. +case $# in + 0) xx='../../src/tail';; + *) xx="$1";; +esac +test "$VERBOSE" && echo=echo || echo=: +$echo testing program: $xx +errors=0 +test "$srcdir" || srcdir=. +test "$VERBOSE" && $xx --version 2> /dev/null +$xx +2c < $srcdir/t1.in > t1.out 2> t1.err +code=$? +if test $code != 0 ; then + $echo Test 1 failed: ../../src/tail return code $code differs from expected value 0 1>&2 + errors=`expr $errors + 1` +else + cmp t1.out $srcdir/t1.exp + case $? in + 0) if test "$VERBOSE" ; then $echo passed 1; fi ;; # equal files + 1) $echo Test 1 failed: files t1.out and $srcdir/t1.exp differ 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo Test 1 may have failed. 1>&2; + $echo The command "cmp t1.out $srcdir/t1.exp" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s t1.err || rm -f t1.err +$xx +8c < $srcdir/t2.in > t2.out 2> t2.err +code=$? +if test $code != 0 ; then + $echo Test 2 failed: ../../src/tail return code $code differs from expected value 0 1>&2 + errors=`expr $errors + 1` +else + cmp t2.out $srcdir/t2.exp + case $? in + 0) if test "$VERBOSE" ; then $echo passed 2; fi ;; # equal files + 1) $echo Test 2 failed: files t2.out and $srcdir/t2.exp differ 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo Test 2 may have failed. 1>&2; + $echo The command "cmp t2.out $srcdir/t2.exp" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s t2.err || rm -f t2.err +$xx -1c < $srcdir/t3.in > t3.out 2> t3.err +code=$? +if test $code != 0 ; then + $echo Test 3 failed: ../../src/tail return code $code differs from expected value 0 1>&2 + errors=`expr $errors + 1` +else + cmp t3.out $srcdir/t3.exp + case $? in + 0) if test "$VERBOSE" ; then $echo passed 3; fi ;; # equal files + 1) $echo Test 3 failed: files t3.out and $srcdir/t3.exp differ 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo Test 3 may have failed. 1>&2; + $echo The command "cmp t3.out $srcdir/t3.exp" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s t3.err || rm -f t3.err +$xx -9c < $srcdir/t4.in > t4.out 2> t4.err +code=$? +if test $code != 0 ; then + $echo Test 4 failed: ../../src/tail return code $code differs from expected value 0 1>&2 + errors=`expr $errors + 1` +else + cmp t4.out $srcdir/t4.exp + case $? in + 0) if test "$VERBOSE" ; then $echo passed 4; fi ;; # equal files + 1) $echo Test 4 failed: files t4.out and $srcdir/t4.exp differ 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo Test 4 may have failed. 1>&2; + $echo The command "cmp t4.out $srcdir/t4.exp" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s t4.err || rm -f t4.err +$xx -12c < $srcdir/t5.in > t5.out 2> t5.err +code=$? +if test $code != 0 ; then + $echo Test 5 failed: ../../src/tail return code $code differs from expected value 0 1>&2 + errors=`expr $errors + 1` +else + cmp t5.out $srcdir/t5.exp + case $? in + 0) if test "$VERBOSE" ; then $echo passed 5; fi ;; # equal files + 1) $echo Test 5 failed: files t5.out and $srcdir/t5.exp differ 1>&2; + errors=`expr $errors + 1` ;; + 2) $echo Test 5 may have failed. 1>&2; + $echo The command "cmp t5.out $srcdir/t5.exp" failed. 1>&2 ; + errors=`expr $errors + 1` ;; + esac +fi +test -s t5.err || rm -f t5.err +if test $errors = 0 ; then + $echo Passed all 5 tests. 1>&2 +else + $echo Failed $errors tests. 1>&2 +fi +test $errors = 0 || errors=1 +exit $errors |