From 28f1844cefb2decc05858fdf8cc62a9ef63a9a31 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 8 Sep 2007 10:09:19 +0200 Subject: Convert tests/ls/, too. --- tests/ls/stat-dtype | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) (limited to 'tests/ls/stat-dtype') 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 -- cgit v1.2.3-54-g00ecf