summaryrefslogtreecommitdiff
path: root/tests/ls/stat-dtype
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-09-08 10:09:19 +0200
committerJim Meyering <jim@meyering.net>2007-09-15 08:40:38 +0200
commit28f1844cefb2decc05858fdf8cc62a9ef63a9a31 (patch)
tree1ba8d121abd2b4bcf259521ce627d1d89d27cefe /tests/ls/stat-dtype
parent7455bf9432c0ae3664803695ddcb27613d20ca8e (diff)
downloadcoreutils-28f1844cefb2decc05858fdf8cc62a9ef63a9a31.tar.xz
Convert tests/ls/, too.
Diffstat (limited to 'tests/ls/stat-dtype')
-rwxr-xr-xtests/ls/stat-dtype38
1 files changed, 11 insertions, 27 deletions
diff --git a/tests/ls/stat-dtype b/tests/ls/stat-dtype
index 3c8a681f5..c5ea4f567 100755
--- a/tests/ls/stat-dtype
+++ b/tests/ls/stat-dtype
@@ -3,7 +3,7 @@
# 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
@@ -26,39 +26,25 @@ if test "$VERBOSE" = yes; then
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
@@ -67,8 +53,7 @@ cat <<\EOF > exp || fail=1
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:
@@ -78,7 +63,6 @@ ls -CF e > out || fail=1
# 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