PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH" \
PERL="$(PERL)" \
PROG=ls
+
+include $(top_srcdir)/tests/check.mk
ls --version
fi
-. $srcdir/../envvar-check
-
-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
+. $srcdir/../test-lib.sh
# Don't let a different umask perturb the results.
umask 22
-framework_failure=0
-mkdir -p $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
-mkdir d other-writable sticky || framework_failure=1
-chmod o+w other-writable || framework_failure=1
-chmod o+t sticky || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+mkdir d other-writable sticky || framework_failure
+chmod o+w other-writable || framework_failure
+chmod o+t sticky || framework_failure
fail=0
^[[m
EOF
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
(exit $fail); exit $fail
#!/bin/sh
# Make sure ls properly handles dangling symlinks vs. ls's -L, -H, options.
-# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --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
+. $srcdir/../test-lib.sh
-framework_failure=0
-mkdir -p $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-ln -s no-such-file dangle || framework_failure=1
-mkdir -p dir/sub || framework_failure=1
-ln -s dir slink-to-dir || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+ln -s no-such-file dangle || framework_failure
+mkdir -p dir/sub || framework_failure
+ln -s dir slink-to-dir || framework_failure
fail=0
sub
EOF
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
(exit $fail); exit $fail
#!/bin/sh
# make sure --dired option works
-# Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2001-2002, 2004, 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --version
fi
-. $srcdir/../envvar-check
+. $srcdir/../test-lib.sh
-pwd=`pwd`
-tmp=dired.$$
-trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
-
-framework_failure=0
-mkdir $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-mkdir dir || framework_failure=1
-
-if test $framework_failure = 1; then
- echo 'failure in testing framework' 1>&2
- (exit 1); exit 1
-fi
+mkdir dir || framework_failure
fail=0
//DIRED-OPTIONS// --quoting-style=literal
EOF
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
(exit $fail); exit $fail
#!/bin/sh
# contrast ls -F, ls -p, and ls --indicator-style=file-type
-# Copyright (C) 2002, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2005-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --version
fi
-. $srcdir/../envvar-check
. $srcdir/../lang-default
+. $srcdir/../test-lib.sh
-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
mkdir sub
cd sub
mkdir dir
cd ..
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
-
fail=0
ls -F sub > out || fail=1
sed 's/[@|]$//' exp2 > exp3
ls -p sub > out3 || fail=1
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
-cmp out2 exp2 || fail=1
-test $fail = 1 && diff out2 exp2 2> /dev/null
+compare out2 exp2 || fail=1
-cmp out3 exp3 || fail=1
-test $fail = 1 && diff out3 exp3 2> /dev/null
+compare out3 exp3 || fail=1
ls --color=auto -F sub > out || fail=1
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
(exit $fail); exit $fail
#!/bin/sh
# make sure ls -L always follows symlinks
-# Copyright (C) 2000, 2002, 2004, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2002, 2004, 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --version
fi
-pwd=`pwd`
-tmp=follow-sl.$$
-trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
-
-framework_failure=0
-mkdir $tmp || framework_failure=1
-cd $tmp || framework_failure=1
+. $srcdir/../test-lib.sh
# Isolate output files from directory being listed
-mkdir dir dir/sub dir1 || framework_failure=1
-cd dir || framework_failure=1
-ln -s link link || framework_failure=1
-ln -s ../../dir1 sub/link-to-dir || framework_failure=1
+mkdir dir dir/sub dir1 || framework_failure
+cd dir || framework_failure
+ln -s link link || framework_failure
+ln -s ../../dir1 sub/link-to-dir || framework_failure
# Make sure the symlink was created.
# `ln -s link link' succeeds, but creates no file on
# systems running some DJGPP-2.03 libc.
-ls -F link > /dev/null || framework_failure=1
-
-if test $framework_failure = 1; then
- echo 'failure in testing framework'
- (exit 1); exit 1
-fi
+ls -F link > /dev/null || framework_failure
fail=0
sub/link-to-dir:
EOF
-cmp out-L exp-L || {
- fail=1
- diff out-L exp-L
-}
-cmp out-FLR-sub exp-FLR-sub || {
- fail=1
- diff out-FLR-sub exp-FLR-sub
-}
+compare out-L exp-L || fail=1
+compare out-FLR-sub exp-FLR-sub || fail=1
(exit $fail); exit $fail
# show that the following no longer makes ls infloop
# mkdir loop; cd loop; ln -s ../loop sub; ls -RL
-# Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2001-2002, 2004, 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
fi
. $srcdir/../lang-default
+. $srcdir/../test-lib.sh
-pwd=`pwd`
-tmp=infloop.$$
-trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
-
-framework_failure=0
-mkdir $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-mkdir loop || framework_failure=1
-ln -s ../loop loop/sub || framework_failure=1
-
-if test $framework_failure = 1; then
- echo 'failure in testing framework' 1>&2
- (exit 1); exit 1
-fi
+mkdir loop || framework_failure
+ln -s ../loop loop/sub || framework_failure
fail=0
loop/sub/sub:
EOF
-cmp out bad 2>/dev/null && fail=1
+# Make sure we don't get the "bad" output.
+compare out bad > /dev/null 2>&1 && fail=1
(exit $fail); exit $fail
#!/bin/sh
# Make sure that ls -i works properly on symlinks.
-# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --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
+. $srcdir/../test-lib.sh
-framework_failure=0
-mkdir -p $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-touch f || framework_failure=1
-ln -s f slink || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+touch f || framework_failure
+ln -s f slink || framework_failure
fail=0
#!/bin/sh
# exercise the -m option
-# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --version
fi
-. $srcdir/../envvar-check
+. $srcdir/../test-lib.sh
-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
-seq 2000 > b || framework_failure=1
-touch a || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+seq 2000 > b || framework_failure
+touch a || framework_failure
fail=0
0 a, 12 b
EOF
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
(exit $fail); exit $fail
#!/bin/sh
# Ensure that ls -l works on files with nameless uid and/or gid
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --version
fi
-. $srcdir/../envvar-check
. $srcdir/../lang-default
PRIV_CHECK_ARG=require-root . $srcdir/../priv-check
+. $srcdir/../test-lib.sh
$PERL -e 1 > /dev/null 2>&1 || {
echo 1>&2 "$0: configure didn't find a usable version of Perl," \
(exit 77); exit 77
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
-
-touch f || framework_failure=1
-chown $nameless_uid f || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+touch f || framework_failure
+chown $nameless_uid f || framework_failure
fail=0
#!/bin/sh
# make sure ls and `ls -R' do the right thing when invoked with no arguments.
-# Copyright (C) 2001, 2003, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2004, 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --version
fi
-pwd=`pwd`
-tmp=no-args.$$
-trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
+. $srcdir/../test-lib.sh
-framework_failure=0
-mkdir $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-mkdir -p dir/subdir || framework_failure=1
-touch dir/subdir/file2 || framework_failure=1
-ln -s f symlink || framework_failure=1
+mkdir -p dir/subdir || framework_failure
+touch dir/subdir/file2 || framework_failure
+ln -s f symlink || framework_failure
-cat > exp <<\EOF || framework_failure=1
+cat > exp <<\EOF || framework_failure
dir
exp
out
symlink
EOF
-if test $framework_failure = 1; then
- echo 'failure in testing framework'
- (exit 1); exit 1
-fi
-
fail=0
ls -1 > out || fail=1
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
cat > exp <<\EOF
.:
ls -R1 > out || fail=1
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
(exit $fail); exit $fail
# 4.1.1 and 4.1.2 had a bug whereby some recursive listings
# didn't include a blank line between per-directory groups of files.
-# Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2004, 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --version
fi
-. $srcdir/../envvar-check
+. $srcdir/../test-lib.sh
-pwd=`pwd`
-tmp=recursive.$$
-trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
-
-framework_failure=0
-mkdir $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
-mkdir x y a b c a/1 a/2 a/3 || framework_failure=1
-touch f a/1/I a/1/II || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+mkdir x y a b c a/1 a/2 a/3 || framework_failure
+touch f a/1/I a/1/II || framework_failure
fail=0
c:
EOF
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
rm -rf out exp
ls -R1 x y f > out || fail=1
y:
EOF
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
(exit $fail); exit $fail
#!/bin/sh
# Make sure name is used as secondary key when sorting on mtime or ctime.
-# Copyright (C) 1998, 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 1998, 2001-2002, 2004, 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-. $srcdir/../envvar-check
. $srcdir/../lang-default
if test "$VERBOSE" = yes; then
touch --version
fi
-pwd=`pwd`
-tmp=t-ls.$$
-trap 'status=$?; cd "$pwd" && rm -rf $tmp && exit $status' 0
-trap '(exit $?); exit' 1 2 13 15
-
-framework_failure=0
-mkdir $tmp || framework_failure=1
-cd $tmp || framework_failure=1
+. $srcdir/../test-lib.sh
date=1998-01-15
-touch -d "$date" c || framework_failure=1
-touch -d "$date" a || framework_failure=1
-touch -d "$date" b || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+touch -d "$date" c || framework_failure
+touch -d "$date" a || framework_failure
+touch -d "$date" b || framework_failure
fail=0
b
c
EOF
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
rm -rf out exp
ls -1rt a b c > out || fail=1
b
a
EOF
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
(exit $fail); exit $fail
# Also check for the dtype-related (and fs-type dependent) bug
# in coreutils-6.0 that made ls -CF columns misaligned.
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --version
fi
-. $srcdir/../envvar-check
-
-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
+. $srcdir/../test-lib.sh
# Skip this test unless "." is on a file system with useful d_type info.
# FIXME: This uses "ls -p" to decide whether to test "ls" with other options,
# but if ls's d_type code is buggy then "ls -p" might be buggy too.
-mkdir -p c/d || framework_failure=1
-chmod a-x c || framework_failure=1
+mkdir -p c/d || framework_failure
+chmod a-x c || framework_failure
if test "X`ls -p c 2>&1`" != Xd/; then
echo "$0: '.' is not on a suitable file system for this test" 1>&2
echo "$0: skipping this test" 1>&2
(exit 77); exit 77
fi
-mkdir d || framework_failure=1
-ln -s / d/s || framework_failure=1
-chmod 600 d || framework_failure=1
+mkdir d || framework_failure
+ln -s / d/s || framework_failure
+chmod 600 d || framework_failure
-mkdir -p e/a2345 e/b || framework_failure=1
-chmod 600 e || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+mkdir -p e/a2345 e/b || framework_failure
+chmod 600 e || framework_failure
fail=0
s@
EOF
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
rm -f out exp
# Check for the ls -CF misaligned-columns bug:
# rather than the appropriate TAB.
printf 'a2345/\tb/\n' > exp || fail=1
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
(exit $fail); exit $fail
# Verify that ls works properly when it fails to stat a file that is
# not mentioned on the command line.
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --version
fi
-. $srcdir/../envvar-check
. $srcdir/../lang-default
PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
+. $srcdir/../test-lib.sh
-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
-mkdir d || framework_failure=1
-ln -s / d/s || framework_failure=1
-chmod 600 d || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+mkdir d || framework_failure
+ln -s / d/s || framework_failure
+chmod 600 d || framework_failure
fail=0
?????????? ? ? ? s
EOF
-sed 's/^l/?/' out | cmp - exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+sed 's/^l/?/' out | compare - exp || fail=1
# Ensure that the offsets in --dired output are accurate.
rm -f out exp
//DIRED-OPTIONS// --quoting-style=literal
EOF
-sed 's/^ l/ ?/' out | cmp - exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+sed 's/^ l/ ?/' out | compare - exp || fail=1
(exit $fail); exit $fail
ls --version
fi
-. $srcdir/../envvar-check
. $srcdir/../strace
+. $srcdir/../test-lib.sh
-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
-
-touch x || framework_failure=1
-chmod a+x x || framework_failure=1
-ln -s x link-to-x || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+touch x || framework_failure
+chmod a+x x || framework_failure
+ln -s x link-to-x || framework_failure
fail=0
printf '\033[m'
} > exp || fail=1
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
(exit $fail); exit $fail
#!/bin/sh
# Ensure that d_ino (from ls -di) and st_ino (from stat --format=%i) match.
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --version
fi
-. $srcdir/../envvar-check
-
-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
+. $srcdir/../test-lib.sh
fail=0
#!/bin/sh
# Do dereference a symlink arg if its name is written with a trailing slash.
-# Copyright (C) 1999, 2000, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2004, 2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ls --version
fi
-. $srcdir/../envvar-check
. $srcdir/../lang-default
+. $srcdir/../test-lib.sh
-tmp=t-ls.$$
-
-framework_failure=0
-mkdir $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
-mkdir dir || framework_failure=1
-ln -s dir symlink || framework_failure=1
-
-if test $framework_failure = 1; then
- echo 'failure in testing framework'
- exit 1
-fi
+mkdir dir || framework_failure
+ln -s dir symlink || framework_failure
fail=0
set `ls -l symlink/`
# Prior to fileutils-4.0k, the following would have output `... symlink -> dir'.
test "$*" = 'total 0' && : || fail=1
-cd ..
-rm -rf $tmp
-
exit $fail
ls --version
fi
-. $srcdir/../envvar-check
. $srcdir/../lang-default
+. $srcdir/../test-lib.sh
-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
-mkdir subdir || framework_failure=1
-touch subdir/b || framework_failure=1
-touch subdir/a || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+mkdir subdir || framework_failure
+touch subdir/b || framework_failure
+touch subdir/a || framework_failure
fail=0
b a
EOF
-cmp out exp || fail=1
-test $fail = 1 && diff out exp 2> /dev/null
+compare out exp || fail=1
(exit $fail); exit $fail