summaryrefslogtreecommitdiff
path: root/tests/ls/file-type
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ls/file-type')
-rwxr-xr-xtests/ls/file-type29
1 files changed, 6 insertions, 23 deletions
diff --git a/tests/ls/file-type b/tests/ls/file-type
index b9286c207..533bec89c 100755
--- a/tests/ls/file-type
+++ b/tests/ls/file-type
@@ -1,7 +1,7 @@
#!/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
@@ -21,17 +21,9 @@ if test "$VERBOSE" = yes; then
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
@@ -48,11 +40,6 @@ mkfifo fifo
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
@@ -72,17 +59,13 @@ ls --indicator-style=file-type sub > out2 || 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