tests: move another file (expensive) into test-lib.sh
authorJim Meyering <meyering@redhat.com>
Thu, 24 Apr 2008 10:50:24 +0000 (12:50 +0200)
committerJim Meyering <meyering@redhat.com>
Sun, 27 Apr 2008 19:31:32 +0000 (21:31 +0200)
* tests/expensive: Remove file.  Move contents into ...
* tests/test-lib.sh (expensive_): ...here.  New function.
* tests/du/fd-leak: Update caller to use the new function.
* tests/mv/leak-fd: Likewise.
* tests/rm/hash: Likewise.
* tests/tail-2/big-4gb: Likewise.
* tests/Makefile.am (EXTRA_DIST): Remove its name.

tests/Makefile.am
tests/du/fd-leak
tests/expensive [deleted file]
tests/mv/leak-fd
tests/rm/hash
tests/tail-2/big-4gb
tests/test-lib.sh

index 7dfafac..2a16989 100644 (file)
@@ -12,7 +12,6 @@ EXTRA_DIST =          \
   README               \
   check.mk             \
   envvar-check         \
-  expensive            \
   group-names          \
   input-tty            \
   lang-default         \
index c4080ff..73fe4f8 100755 (executable)
@@ -21,10 +21,11 @@ if test "$VERBOSE" = yes; then
   du --version
 fi
 
+. $top_srcdir/tests/test-lib.sh
+
 # Call this an expensive test.  It's not that expensive, but command line
 # limitations might induce failure on some losing systems.
-. $top_srcdir/tests/expensive
-. $top_srcdir/tests/test-lib.sh
+expensive_
 
 # Create 1296 (36^2) files.
 # Their names and separating spaces take up 3887 bytes.
diff --git a/tests/expensive b/tests/expensive
deleted file mode 100644 (file)
index c365f70..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# Is a test expensive?
-
-# Copyright (C) 2000, 2004 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
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-if test "$RUN_EXPENSIVE_TESTS" != yes; then
-  cat <<EOF >&2
-$0: This test is relatively expensive, so it is disabled by default.
-To run it anyway, rerun make check with the RUN_EXPENSIVE_TESTS
-environment variable set to yes.  E.g.,
-
-  env RUN_EXPENSIVE_TESTS=yes make check
-
-EOF
-  (exit 77); exit 77
-fi
index 549d256..1ecdb20 100755 (executable)
@@ -23,15 +23,15 @@ if test "$VERBOSE" = yes; then
   mv --version
 fi
 
-# This test is relatively expensive, and might well evoke a
-# framework-failure on systems with a smaller command-line length
-. $top_srcdir/tests/expensive
-
 . $top_srcdir/tests/test-lib.sh
 skip_if_root_
 cleanup_() { rm -rf "$other_partition_tmpdir"; }
 . "$abs_top_srcdir/tests/other-fs-tmpdir"
 
+# This test is relatively expensive, and might well evoke a
+# framework-failure on systems with a smaller command-line length
+expensive_
+
 b="0 1 2 3 4 5 6 7 8 9
 a b c d e f g h i j k l m n o p q r s t u v w x y z
 _A _B _C _D _E _F _G _H _I _J _K _L _M _N _O _P _Q _R _S _T _U _V _W _X _Y _Z"
index 0b2b6c5..56f96e4 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $top_srcdir/tests/expensive
-
 if test "$VERBOSE" = yes; then
   set -x
   rm --version
 fi
 
 . $top_srcdir/tests/test-lib.sh
+expensive_
 
 # Create a hierarchy with 3*26 leaf directories, each at depth 153.
 echo "$0: creating 78 trees, each of depth 153; this will take a while..." >&2
index b7d2528..8b64c6e 100755 (executable)
@@ -22,8 +22,8 @@ if test "$VERBOSE" = yes; then
   tail --version
 fi
 
-. $top_srcdir/tests/expensive
 . $top_srcdir/tests/test-lib.sh
+expensive_
 
 # Create a file of size exactly 4GB (2^32) with 8 bytes
 # at the beginning and another set of 8 bytes at the end.
index 8f56ab1..78ac97d 100644 (file)
@@ -151,6 +151,19 @@ environment variable set to yes.  E.g.,
   fi
 }
 
+expensive_()
+{
+  if test "$RUN_EXPENSIVE_TESTS" != yes; then
+    skip_test_ '
+This test is relatively expensive, so it is disabled by default.
+To run it anyway, rerun make check with the RUN_EXPENSIVE_TESTS
+environment variable set to yes.  E.g.,
+
+  env RUN_EXPENSIVE_TESTS=yes make check
+'
+  fi
+}
+
 require_root_()
 {
   uid_is_privileged_ || skip_test_ "must be run as root"