tests: factor 350 fail=0 initializations into test-lib.sh
[platform/upstream/coreutils.git] / tests / du / long-sloop
index f6adf72..99f7a15 100755 (executable)
@@ -3,7 +3,7 @@
 # Show that du fails with ELOOP (Too many levels of symbolic links)
 # when it encounters that condition.
 
-# Copyright (C) 2006-2007 Free Software Foundation, Inc.
+# Copyright (C) 2006-2009 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
@@ -23,8 +23,7 @@ if test "$VERBOSE" = yes; then
   du --version
 fi
 
-. $srcdir/../lang-default
-. $srcdir/../test-lib.sh
+. $srcdir/test-lib.sh
 
 # Create lots of directories, each containing a single symlink
 # pointing at the next directory in the list.
@@ -58,17 +57,11 @@ echo foo > $i
 # renders it as `Number of symbolic links encountered during path
 # name traversal exceeds MAXSYMLINKS'.
 
-cat $file > /dev/null 2> err && \
-  {
-    cat <<EOF >&2
-$0: Your system appears to be able to handle more than $n symlinks
-in file name resolution, so skipping this test.
-EOF
-    (exit 77); exit 77
-  }
+cat $file > /dev/null 2> err &&
+    skip_test_ 'Your system appears to be able to handle more than $n symlinks
+in file name resolution'
 too_many=`sed 's/.*: //' err`
 
-fail=0
 
 # With coreutils-5.93 there was no failure.
 # With coreutils-5.94 we get the desired diagnostic:
@@ -80,4 +73,4 @@ echo "du: cannot access: $too_many" > exp || fail=1
 
 compare out exp || fail=1
 
-(exit $fail); exit $fail
+Exit $fail