2 # Ensure that tac processes all command line arguments, even
3 # when it encounters an error with say the first one.
4 # With coreutils-5.2.1 and earlier, this test would fail.
6 # Copyright (C) 2004, 2006-2009 Free Software Foundation, Inc.
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 if test "$VERBOSE" = yes; then
28 # See if the envvar is defined.
29 if test x = "x$FULL_PARTITION_TMPDIR"; then
30 skip_test_ "FULL_PARTITION_TMPDIR not defined"
33 if ! test -d "$FULL_PARTITION_TMPDIR"; then
34 echo "$0: $FULL_PARTITION_TMPDIR:" \
35 "\$FULL_PARTITION_TMPDIR does not specify a directory" 1>&2
39 fp_tmp="$FULL_PARTITION_TMPDIR/tac-cont-$$"
40 cleanup_() { rm -f "$fp_tmp"; }
42 # Make sure we can create an empty file there (i.e. no shortage of inodes).
43 if ! touch $fp_tmp; then
44 echo "$0: $fp_tmp: cannot create empty file" 1>&2
48 # Make sure that we fail when trying to create a file large enough
49 # to consume a non-inode block.
50 if seq 1000 > $fp_tmp 2>/dev/null; then
51 echo "$0: $FULL_PARTITION_TMPDIR: not a full partition" 1>&2
58 # Give tac a fifo command line argument.
59 # This makes it try to create a temporary file in $TMPDIR.
62 TMPDIR=$FULL_PARTITION_TMPDIR tac fifo in >out 2>err && fail=1
64 cat <<\EOF > exp || fail=1
72 compare out exp || fail=1