summaryrefslogtreecommitdiff
path: root/tests/misc/ls-time
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/ls-time')
-rwxr-xr-xtests/misc/ls-time43
1 files changed, 9 insertions, 34 deletions
diff --git a/tests/misc/ls-time b/tests/misc/ls-time
index 9456411bd..4099e6b99 100755
--- a/tests/misc/ls-time
+++ b/tests/misc/ls-time
@@ -22,33 +22,13 @@ 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
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+. $srcdir/../test-lib.sh
# Avoid any possible glitches due to daylight-saving changes near the
# time stamps used during the test.
TZ=UTC0
export TZ
-tmp=t-ls.$$
-
-framework_failure=0
-mkdir $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
t1='1998-01-15 21:00'
t2='1998-01-15 22:00'
t3='1998-01-15 23:00'
@@ -57,15 +37,15 @@ u1='1998-01-14 11:00'
u2='1998-01-14 12:00'
u3='1998-01-14 13:00'
-touch -m -d "$t3" a || framework_failure=1
-touch -m -d "$t2" b || framework_failure=1
-touch -m -d "$t1" c || framework_failure=1
+touch -m -d "$t3" a || framework_failure
+touch -m -d "$t2" b || framework_failure
+touch -m -d "$t1" c || framework_failure
-touch -a -d "$u3" c || framework_failure=1
-touch -a -d "$u2" b || framework_failure=1
+touch -a -d "$u3" c || framework_failure
+touch -a -d "$u2" b || framework_failure
# Make sure A has ctime at least 1 second more recent than C's.
sleep 2
-touch -a -d "$u1" a || framework_failure=1
+touch -a -d "$u1" a || framework_failure
fail=0
@@ -78,7 +58,7 @@ test "$*" = 'a c' || fail=1
sleep 2
# Create a link, updating c's ctime.
-ln c d || framework_failure=1
+ln c d || framework_failure
# Before we go any further, verify that touch's -m option works.
set -- `ls --full -l a`
@@ -95,7 +75,7 @@ have been $t3.
EOF
#`
ls --full -l a
- framework_failure=1
+ framework_failure
;;
esac
@@ -117,11 +97,6 @@ EOF
;;
esac
-if test $framework_failure = 1; then
- echo 'failure in testing framework'
- exit 1
-fi
-
set `ls -ut a b c`
test "$*" = 'c b a' && : || fail=1
test $fail = 1 && ls -l --full-time --time=access a b c