fi
# Require that the final line of each test-lib.sh-using test be this one:
-# (exit $fail); exit $fail
+# Exit $fail
# Note: this test requires GNU grep's --label= option.
sc_require_test_exit_idiom:
@if test -f $(srcdir)/tests/test-lib.sh; then \
die=0; \
for i in $$(grep -l -F /../test-lib.sh $$($(VC_LIST) tests)); do \
- tail -n1 $$i | grep '^(exit \$$fail); exit \$$fail$$' > /dev/null \
+ tail -n1 $$i | grep '^Exit \$$fail$$' > /dev/null \
&& : || { die=1; echo $$i; } \
done; \
test $$die = 1 && \
{ echo 1>&2 '$(ME): the final line in each of the above is not:'; \
- echo 1>&2 '(exit $$fail); exit $$fail'; \
+ echo 1>&2 'Exit $$fail'; \
exit 1; } || :; \
fi
esac
}
-(exit $fail); exit $fail
+Exit $fail
chgrp -R $g2 d || fail=1
test `stat --printf=%g f` = $g_init || fail=1
-(exit $fail); exit $fail
+Exit $fail
set _ `ls -ln f`; g=$5; test "$g" = $g1 || fail=1
set _ `ls -ln symlink`; g=$5; test "$g" = $g2 || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
test $group = $g1 || fail=1
done
-(exit $fail); exit $fail
+Exit $fail
# But it *should* change d/dd.
set _ `ls -ln d/dd`; g=$5; test "$g" = $g1 || fail=1
-(exit $fail); exit $fail
+Exit $fail
*) fail=1 ;;
esac
-(exit $fail); exit $fail
+Exit $fail
esac
done
-(exit $fail); exit $fail
+Exit $fail
actual_perms=`ls -l f|cut -b-10`
test "$actual_perms" = "-rwxr-x---" || fail=1
-(exit $fail); exit $fail
+Exit $fail
chmod u+rwx d d/e || fail=1
-(exit $fail); exit $fail
+Exit $fail
# an abort (exit with status 134) on recent glibc-based systems.
test $? = 1 || fail=1
-(exit $fail); exit $fail
+Exit $fail
chmod 7-followed-by-anything . 2> /dev/null && fail=1
chmod 8 . 2> /dev/null && fail=1
-(exit $fail); exit $fail
+Exit $fail
case `ls -ld d` in drwxr-sr-x*);; *) fail=1;; esac
-(exit $fail); exit $fail
+Exit $fail
echo "chmod: cannot operate on dangling symlink \`dangle'" > exp
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
chmod 755 file
(umask 77 && chmod -x file) 2>/dev/null && fail=1
-(exit $fail); exit $fail
+Exit $fail
esac
done
-(exit $fail); exit $fail
+Exit $fail
# owner/group on the symlink should be changed
set _ `ls -n slink`; shift; test "$3:$4" = 2:10 || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
done
done
-(exit $fail); exit $fail
+Exit $fail
&& case $(cat t) in i);; *) fail=1;; esac
done
-(exit $fail); exit $fail
+Exit $fail
acl2=`cd b && getfacl file` || framework_failure
test "$acl1" = "$acl2" || fail=1
-(exit $fail); exit $fail
+Exit $fail
test -f $file_backup || fail=1
compare $file $file_backup > /dev/null || fail=1
-(exit $fail); exit $fail
+Exit $fail
test -d y/x || fail=1
test -d y/x~ && fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out2 exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# FIXME: test -L, too.
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
test -d a/c || fail=1
test -d b/c || fail=1
-(exit $fail); exit $fail
+Exit $fail
# coreutils 6.2 cp would neglect to prompt in this case.
echo n | cp -iR a b 2>/dev/null || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare $expected $actual || fail=1
-(exit $fail); exit $fail
+Exit $fail
p=`ls -ld e/d/a/b/c|cut -b-10`; case $p in drwxr-xr-x);; *) fail=1;; esac
p=`ls -ld g/sym/b/c|cut -b-10`; case $p in drwxr-xr-x);; *) fail=1;; esac
-(exit $fail); exit $fail
+Exit $fail
fail=0
cp -d f slink || fail=1
-(exit $fail); exit $fail
+Exit $fail
# ...and again, with an existing destination.
cp -R --remove-destination d e || fail=1
-(exit $fail); exit $fail
+Exit $fail
test -r dir2/dir1/file || fail=1
test -r dir1/file || fail=1
-(exit $fail); exit $fail
+Exit $fail
# In 4.0.35, it was.
test -f file || fail=1
-(exit $fail); exit $fail
+Exit $fail
*) fail=1;;
esac
-(exit $fail); exit $fail
+Exit $fail
chmod 700 D
-(exit $fail); exit $fail
+Exit $fail
wait $cp_pid || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
cp -f --link src dest || fail=1
cp -f --symbolic-link src dest2 || fail=1
-(exit $fail); exit $fail
+Exit $fail
# with link being applied to the dangling symlink.
cp --link --no-dereference dangling-slink d2 || fail=1
-(exit $fail); exit $fail
+Exit $fail
umask 022
# --------------------------------------
-(exit $fail); exit $fail
+Exit $fail
test "`cat a/foo`" = $msg || fail=1
-(exit $fail); exit $fail
+Exit $fail
test "`cat a`" = $msg || fail=1
-(exit $fail); exit $fail
+Exit $fail
test "`cat a`" = $msg || fail=1
-(exit $fail); exit $fail
+Exit $fail
fail=1
done
-(exit $fail); exit $fail
+Exit $fail
wait $cp_pid || fail=1
done
-(exit $fail); exit $fail
+Exit $fail
done
done
-(exit $fail); exit $fail
+Exit $fail
cp --preserve=mode,links f g || fail=1
-(exit $fail); exit $fail
+Exit $fail
:
else
echo "$0: $* $f b: $u $g != $s" 1>&2
- (exit 1); exit 1
+ Exit 1
fi
fi
}
t1 c1 "$nameless_uid" "$nameless_gid2" cp -p
fail=0
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
*) fail=1;;
esac
-(exit $fail); exit $fail
+Exit $fail
compare $expected $actual 1>&2 || fail=1
-(exit $fail); exit $fail
+Exit $fail
cp --update --no-dereference a b || fail=1
cp --update --no-dereference c d || fail=1
-(exit $fail); exit $fail
+Exit $fail
# Ensure that the copy has the same block count as the original.
test `stat --printf %b copy` -le `stat --printf %b sparse` || fail=1
-(exit $fail); exit $fail
+Exit $fail
set _ `ls -l c2`; shift; p2=$1
test $p1 = $p2 && fail=1
-(exit $fail); exit $fail
+Exit $fail
cp -Rf fifo e || fail=1
test -p fifo || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# call and so cp ends up dereferencing the symlink and copying the directory.
test "$*" = 'total 0' && : || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
test $fail -eq 0 && fail=$warn
-(exit $fail); exit $fail
+Exit $fail
*) fail=1 ;;
esac
-(exit $fail); exit $fail
+Exit $fail
*) fail=1 ;;
esac
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
df --total | $EGREP "$RE_TOTAL" || fail=1
df -i --total | $EGREP "$RE_TOTAL" || fail=1
-(exit $fail); exit $fail
+Exit $fail
$AWK -f parse_total.awk tmp > out2 || fail=1
compare out1 out2 || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
fi
-(exit $fail); exit $fail
+Exit $fail
# du: `b': No such file or directory
du -sD slink b > /dev/null 2>&1 || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# With coreutils-5.0, this would fail due to a file descriptor leak.
du $f > out || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
du "$cwd/a" > /dev/null || fail=1
-(exit $fail); exit $fail
+Exit $fail
fail=0
du -s "$cwd/$dir" > /dev/null || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
du a b > out || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# Require that at least one of these symlinks has a non-zero size.
grep '^[1-9]' out > /dev/null || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
du . $t > /dev/null || fail=1
du .. $t > /dev/null || fail=1
-(exit $fail); exit $fail
+Exit $fail
`file' -> `sub3/a/b/c/file'
EOF
-(exit $fail); exit $fail
+Exit $fail
test -d no-dir1/no-dir2 || fail=1
test -r no-dir1/no-dir2/dest || fail=1
-(exit $fail); exit $fail
+Exit $fail
ginstall -d d2/.. || fail=1
test -d d2 || fail=1
-(exit $fail); exit $fail
+Exit $fail
ginstall src dest -s --strip-program=./b || fail=1
compare dest exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
exec ginstall -s "$abs_top_builddir/src/ginstall$EXEEXT" .
)
-(exit $fail); exit $fail
+Exit $fail
ln b b~ || fail=1
ln -f --b=simple a b || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# ===================================================
-(exit $fail); exit $fail
+Exit $fail
*) fail=1 ;;
esac
-(exit $fail); exit $fail
+Exit $fail
fail=0
ln -s --target-dir=d ../f || fail=1
-(exit $fail); exit $fail
+Exit $fail
printf "\033[0m\033[${code}mtest\033[0m\n\033[m" > out_ok || fail=1
compare out out_ok || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
ls --color=auto -F sub > out || fail=1
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out-L exp-L || fail=1
compare out-FLR-sub exp-FLR-sub || fail=1
-(exit $fail); exit $fail
+Exit $fail
# Make sure we don't get the "bad" output.
compare out bad > /dev/null 2>&1 && fail=1
-(exit $fail); exit $fail
+Exit $fail
# With -H, they must be different from inside a directory.
test "$1" != "$3" || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
set -- `ls -o f` || fail=1
test $3 = $nameless_uid || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
fail=0
ls -l $f > out || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
EOF
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
sed 's/^ l/ ?/' out | compare - exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
test $dev_ino = $root_dev_ino && break
done
-(exit $fail); exit $fail
+Exit $fail
# Prior to fileutils-4.0k, the following would have output `... symlink -> dir'.
test "$*" = 'total 0' && : || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
echo 'changing security context of `f'\' > exp
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# No file
chcon -u anyone 2> /dev/null && fail=1
-(exit $fail); exit $fail
+Exit $fail
cp --verbose a b >/dev/full 2>/dev/null && fail=1
fi
-(exit $fail); exit $fail
+Exit $fail
csplit in '/x\{1\}/' '{*}' > /dev/null || fail=1
cat xx?? | compare - in || fail=1
-(exit $fail); exit $fail
+Exit $fail
*) fail=1;;
esac
-(exit $fail); exit $fail
+Exit $fail
fail=1;;
esac
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
false --version > /dev/null && fail=1
false --help > /dev/null && fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
*) fail=1 ;;
esac
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
fail=0
test "$built_programs" \
- || { echo "$this_test: no programs built!?!" 1>&2; (exit $fail); exit $fail; }
+ || { echo "$this_test: no programs built!?!" 1>&2; Exit $fail; }
for lang in C fr da; do
for i in $built_programs; do
rm -rf $tmp_in $tmp_in2 $tmp_out $tmp_dir
done
-(exit $fail); exit $fail
+Exit $fail
id -nu > /dev/null \
&& id $(id -nu) | grep context= >/dev/null && fail=1
-(exit $fail); exit $fail
+Exit $fail
have been $u1.
EOF
ls --full -lu a
- (exit 77); exit 77
+ Exit 77
;;
esac
fail=1
fi
-(exit $fail); exit $fail
+Exit $fail
mode=`ls -dgo f3|cut -b-10`
test $mode = drwx-wxr-- || test $mode = drwx-wsr-- || fail=1
-(exit $fail); exit $fail
+Exit $fail
shift; shift; shift
done
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
nohup >/dev/null 2>&1
test $? = 127 || fail=1
-(exit $fail); exit $fail
+Exit $fail
EOF
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
pathchk -P -- - > /dev/null 2>&1 && fail=1
pathchk -p -P x/- > /dev/null 2>&1 && fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
*) fail=1;;
esac
-(exit $fail); exit $fail
+Exit $fail
ptx -W 'bar\\\' $f < /dev/null >> out || fail=1
compare out empty || fail=1
-(exit $fail); exit $fail
+Exit $fail
fail=$?
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
echo "readlink: loop: $symlink_loop_msg" > exp || framework_failure
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
c=`stat --printf %C s2/$i`; test x$c = x$ctx || fail=1
done
-(exit $fail); exit $fail
+Exit $fail
test -f c && fail=1
done
-(exit $fail); exit $fail
+Exit $fail
# When the command completes, expect it to fail.
shred -u $file > /dev/null 2>&1 && fail=1 || :
-(exit $fail); exit $fail
+Exit $fail
printf '1\0' > exp || framework_failure
cmp out exp || { fail=1; echo "missing NUL terminator?" 1>&2; }
-(exit $fail); exit $fail
+Exit $fail
PATH=. "$SORT" -S 1k in > out || fail=1
compare exp out || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare in out1 || { fail=1; echo "not a permutation with LC_ALL=$locale" 1>&2; }
fi
-(exit $fail); exit $fail
+Exit $fail
fail=0
sort --sort=version -o out in || fail=1
compare exp out || fail=1
-(exit $fail); exit $fail
+Exit $fail
n=$(expr $n + 1)
done
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare xac exp-3 || fail=1
test -f xad && fail=1
-(exit $fail); exit $fail
+Exit $fail
test "$out" = "$fmt" || fail=1
done
-(exit $fail); exit $fail
+Exit $fail
stty `cat $saved_state`
-(exit $fail); exit $fail
+Exit $fail
# the state of our tty), try to restore the initial state.
stty $saved_state || fail=1
-(exit $fail); exit $fail
+Exit $fail
set x $saved_size
stty rows $2 columns $3 || exit 1
-(exit $fail); exit $fail
+Exit $fail
EOF
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
if ! test -d "$FULL_PARTITION_TMPDIR"; then
echo "$0: $FULL_PARTITION_TMPDIR:" \
"\$FULL_PARTITION_TMPDIR does not specify a directory" 1>&2
- (exit 1); exit 1
+ Exit 1
fi
fp_tmp="$FULL_PARTITION_TMPDIR/tac-cont-$$"
# Make sure we can create an empty file there (i.e. no shortage of inodes).
if ! touch $fp_tmp; then
echo "$0: $fp_tmp: cannot create empty file" 1>&2
- (exit 1); exit 1
+ Exit 1
fi
# Make sure that we fail when trying to create a file large enough
# to consume a non-inode block.
if seq 1000 > $fp_tmp 2>/dev/null; then
echo "$0: $FULL_PARTITION_TMPDIR: not a full partition" 1>&2
- (exit 1); exit 1
+ Exit 1
fi
seq 5 > in
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
done
done
-(exit $fail); exit $fail
+Exit $fail
fail=0
tee - </dev/null || fail=1
-(exit $fail); exit $fail
+Exit $fail
timeout 1 sleep 2
test $? = 124 || fail=1
-(exit $fail); exit $fail
+Exit $fail
# non existant command
timeout 1 ... && fail=1
-(exit $fail); exit $fail
+Exit $fail
test -f truncate-target || fail=1
-(exit $fail); exit $fail
+Exit $fail
# truncate on dir not allowed
truncate -s+0 . && fail=1 || fail=0
-(exit $fail); exit $fail
+Exit $fail
#truncate: cannot open \`$dir' for writing: Not a directory
#truncate: cannot open \`$dir' for writing: Is a directory
-(exit $fail); exit $fail
+Exit $fail
truncate -s0 "fifo" || fail=1
-(exit $fail); exit $fail
+Exit $fail
# truncate -c no-such-file should not fail.
truncate -s0 -c no-such-file || fail=1
-(exit $fail); exit $fail
+Exit $fail
truncate -s+2147483647 non-empty-file && fail=1
fi
-(exit $fail); exit $fail
+Exit $fail
setuidgid $NON_ROOT_USERNAME env PATH="$PATH" truncate -s0 root-owned || fail=1
-(exit $fail); exit $fail
+Exit $fail
truncate --size=" +1" file || fail=1 #file now 2
test $(stat --format %s file) = 2 || fail=1
-(exit $fail); exit $fail
+Exit $fail
# division by zero
truncate --size="%0" file && fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
fi
-(exit $fail); exit $fail
+Exit $fail
mkdir --parents "`pwd`/t" || fail=1
test -d t || fail=1
-(exit $fail); exit $fail
+Exit $fail
mkdir --parents "`pwd`/t/u" || fail=1
test -d t/u || fail=1
-(exit $fail); exit $fail
+Exit $fail
# With coreutils-5.3.0, this would fail with $b=bu.
test "x$b" = xb || fail=1
-(exit $fail); exit $fail
+Exit $fail
mkdir -p d2/.. || fail=1
test -d d2 || fail=1
-(exit $fail); exit $fail
+Exit $fail
mkdir -p slink/x || fail=1
test -d x || fail=1
-(exit $fail); exit $fail
+Exit $fail
mkdir: created directory `foo/a/b/c/d'
EOF
-(exit $fail); exit $fail
+Exit $fail
# `d's perms are determined by the -m argument.
p=`ls -ld a/b/c/d|cut -b-10`; case $p in $d_mode_str);; *) fail=1;; esac
-(exit $fail); exit $fail
+Exit $fail
done
done
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
done
-(exit $fail); exit $fail
+Exit $fail
*) fail=1 ;;
esac
-(exit $fail); exit $fail
+Exit $fail
mkdir d2/ || fail=1
test -d d2 || fail=1
-(exit $fail); exit $fail
+Exit $fail
umount /tmp/2
umount /tmp/1
-(exit $fail); exit $fail
+Exit $fail
acl2=`cd $other_partition_tmpdir && getfacl dir2` || framework_failure
test "$acl1" = "$acl2" || fail=1
-(exit $fail); exit $fail
+Exit $fail
# Ensure that the destination, s2, contains the link from s1.
test "`readlink s2`" = t1 || fail=1
-(exit $fail); exit $fail
+Exit $fail
n_links=`stat --printf=%h b` || fail=1
test "$n_links" = 1 || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out2 exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# b/f and c/f must not be linked
test `stat --format %i b/f` = `stat --format %i c/f` && fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
mv dir file > /dev/null 2>&1 && fail=1
mv file dir > /dev/null 2>&1 && fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
done
-(exit $fail); exit $fail
+Exit $fail
# device and inodes are the same.
mv $ff $ff2 || fail=1
-(exit $fail); exit $fail
+Exit $fail
test $ia = $ib || fail=1
test $ia = $ic || fail=1
-(exit $fail); exit $fail
+Exit $fail
ib=`ls -i x/b` || fail=1; set x $ib; ib=$2
test "$ia" = "$ib" && fail=1
-(exit $fail); exit $fail
+Exit $fail
test -r b || fail=1
test -r b~ || fail=1
-(exit $fail); exit $fail
+Exit $fail
b=`sed -n 's/ b$//p' out`
test "$a" = "$b" || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
test -f h || fail=1
compare g h || fail=1
-(exit $fail); exit $fail
+Exit $fail
*) fail=1 ;;
esac
-(exit $fail); exit $fail
+Exit $fail
test -r a && fail=1
test -r b || fail=1
-(exit $fail); exit $fail
+Exit $fail
# coreutils 6.2 mv would neglect to prompt in this case.
echo n | mv -i a b 2>/dev/null || fail=1
-(exit $fail); exit $fail
+Exit $fail
*) fail=1;;
esac
-(exit $fail); exit $fail
+Exit $fail
# Make sure the file has been moved to the right place.
test -f $dir/$file || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out2 exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out2 exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# Before 4.0.36, `s' would have been removed.
test -f s || fail=1
-(exit $fail); exit $fail
+Exit $fail
out=$(ls -A) || fail=1
test -z "$out" || fail=1
-(exit $fail); exit $fail
+Exit $fail
# cd $other_partition_tmpdir
# ls -l -A -R $other_partition_tmpdir
-(exit $fail); exit $fail
+Exit $fail
# rename must fail, since the src is not a directory.
mv -fT f e2 2> /dev/null && fail=1
-(exit $fail); exit $fail
+Exit $fail
fi
test $fail = 1 && diff out exp 2> /dev/null
-(exit $fail); exit $fail
+Exit $fail
set `ls -Ci a/1 b/1`
test $1 = $3 || fail=1
-(exit $fail); exit $fail
+Exit $fail
mv foo/ $other_partition_tmpdir/bar || fail=1
-(exit $fail); exit $fail
+Exit $fail
# Redirect to stderr, since stdout is already taken.
compare $expected $actual 1>&2 || fail=1
-(exit $fail); exit $fail
+Exit $fail
mode=`ls -l $other_partition_tmpdir/file|cut -b-10`
test "$mode" = "-rwxrwxrwx" || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp_err || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# Make sure $rem_file is unmodified.
test `cat $rem_file` = remote || fail=1
-(exit $fail); exit $fail
+Exit $fail
#touch a a2
#mv a a2/ && fail=1
-(exit $fail); exit $fail
+Exit $fail
case "`cat old`" in new) ;; *) fail=1 ;; esac
case "`cat new`" in new) ;; *) fail=1 ;; esac
-(exit $fail); exit $fail
+Exit $fail
test -z "$v" || fail=1
done
-(exit $fail); exit $fail
+Exit $fail
test -z "$v" || fail=1
done
-(exit $fail); exit $fail
+Exit $fail
done
-(exit $fail); exit $fail
+Exit $fail
v=`readlink missing` && fail=1
test -z "$v" || fail=1
-(exit $fail); exit $fail
+Exit $fail
$PERL -e 'use warnings' > /dev/null 2>&1 || {
echo 1>&2 "$0: configure did not find a usable version of Perl," \
"so skipping this test"
- (exit 77); exit 77
+ Exit 77
}
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
kill $pid > /dev/null 2>&1
-(exit $fail); exit $fail
+Exit $fail
# Make sure all of $t was deleted.
test -d $t && fail=1
-(exit $fail); exit $fail
+Exit $fail
# the directory must have been removed
test -d x && fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# Before coreutils-5.93 this test would fail on Solaris 9 and newer.
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
rm -r a b || fail=1
-(exit $fail); exit $fail
+Exit $fail
rm -rf a || fail=1
test -d a && fail=1
-(exit $fail); exit $fail
+Exit $fail
fail=0
rm -f d/no-such-file || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
EOF
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
rm -r t || fail=1
-(exit $fail); exit $fail
+Exit $fail
rm -rf $t
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# The directory must remain.
test -d dir || fail=1
-(exit $fail); exit $fail
+Exit $fail
# Example from Andreas Schwab.
rm -f existing-non-dir/f > out 2>&1 || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out expout || fail=1
compare err experr || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out expout || fail=1
compare err experr || fail=1
-(exit $fail); exit $fail
+Exit $fail
*) fail=1 ;;
esac
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# f must have been removed.
test -f d/f && fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# Compare expected and actual output.
compare $test.E $test.O || fail=1
-(exit $fail); exit $fail
+Exit $fail
# Compare expected and actual output.
cmp t/E t/O || fail=1
-(exit $fail); exit $fail
+Exit $fail
rm -rf t || fail=1
test -d t && fail=1
-(exit $fail); exit $fail
+Exit $fail
test -f d/a || fail=1
-(exit $fail); exit $fail
+Exit $fail
test -d b && fail=1
-(exit $fail); exit $fail
+Exit $fail
test -d b/c && fail=1
test -d b/d && fail=1
-(exit $fail); exit $fail
+Exit $fail
chmod u+x b
test -d b/3 || fail=1
-(exit $fail); exit $fail
+Exit $fail
test -d z && fail=1
-(exit $fail); exit $fail
+Exit $fail
test -d dir || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
fail=0
rm -r '' > /dev/null 2>&1 && fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
test -d "$t/d" && fail=1
test -d "$t/e" && fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
# As of coreutils-5.1.2, it fails, as required.
rmdir -p d d/e/f 2> /dev/null && fail=1
-(exit $fail); exit $fail
+Exit $fail
test -d "$cwd/a/b" && fail=1
test -d "$cwd/a/b/c" && fail=1
-(exit $fail); exit $fail
+Exit $fail
# rmdir: `dir': No such file or directory
rmdir -p dir/ || fail=1
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
tail --pid=$pid -f f > /dev/null 2>&1 || fail=1
chattr -a f 2>/dev/null
-(exit $fail); exit $fail
+Exit $fail
test $fail = 1 && cat err
-(exit $fail); exit $fail
+Exit $fail
test $fail = 1 && cat err
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
fail=0
kill $tail_pid && fail=1 || :
-(exit $fail); exit $fail
+Exit $fail
tail $ksyms > /dev/null || fail=1
fi
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
done
done
-(exit $fail); exit $fail
+Exit $fail
eval 'function_test() { return 11; }; function_test'
if test $? != 11; then
echo "$0: /bin/sh lacks support for functions; skipping this test." 1>&2
- (exit 77); exit 77
+ Exit 77
fi
skip_test_()
{
echo "$0: skipping test: $@" 1>&2
- (exit 77); exit 77
+ Exit 77
}
require_acl_()
}
skip_if_root_() { uid_is_privileged_ && skip_test_ "must be run as non-root"; }
-error_() { echo "$0: $@" 1>&2; (exit 1); exit 1; }
+error_() { echo "$0: $@" 1>&2; Exit 1; }
framework_failure() { error_ 'failure in testing framework'; }
# Set `groups' to a space-separated list of at least two groups
esac
}
+# We use a trap below for cleanup. This requires us to go through
+# hoops to get the right exit status transported through the signal.
+# So use `Exit STATUS' instead of `exit STATUS' inside of the tests.
+# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
+# sh inside this function.
+Exit ()
+{
+ set +e
+ (exit $1)
+ exit $1
+}
+
test_dir_=$(pwd)
this_test_() { echo "./$0" | sed 's,.*/,,'; }
# Run each test from within a temporary sub-directory named after the
# test itself, and arrange to remove it upon exception or normal exit.
trap remove_tmp_ 0
-trap '(exit $?); exit $?' 1 2 13 15
+trap 'Exit $?' 1 2 13 15
cd "$t_" || error_ "failed to cd to $t_"
esac
fi
-(exit $fail); exit $fail
+Exit $fail
fail=0
touch . || fail=1
-(exit $fail); exit $fail
+Exit $fail
EOF
fi
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail
touch fifo || fail=1
-(exit $fail); exit $fail
+Exit $fail
touch -ca - >&- 2> /dev/null || fail=1
fi
-(exit $fail); exit $fail
+Exit $fail
# Also test the combination of --no-create and -a.
touch -a --no-create t1 || fail=1
-(exit $fail); exit $fail
+Exit $fail
test $fail = 1 && diff out exp 2> /dev/null
-(exit $fail); exit $fail
+Exit $fail
setuidgid $NON_ROOT_USERNAME env PATH="$PATH" touch -d now root-owned || fail=1
-(exit $fail); exit $fail
+Exit $fail
rm -f $y2000 file || fail=1
touch $y2000 file && test -f $y2000 && test -f file || fail=1
-(exit $fail); exit $fail
+Exit $fail
touch - 1< read-only 2> /dev/null && { test ! -f - || fail=1; }
-(exit $fail); exit $fail
+Exit $fail
compare out exp || fail=1
-(exit $fail); exit $fail
+Exit $fail