summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2008-04-24 12:50:24 +0200
committerJim Meyering <meyering@redhat.com>2008-04-27 21:31:32 +0200
commit427f179542e9f7228f77affdd5a4c50a573b4894 (patch)
treebe86b7543a8777f22288e576b032d6ef4a3931bc /tests
parent8dc387dba567da10e2e90107fd044baaef580145 (diff)
downloadcoreutils-427f179542e9f7228f77affdd5a4c50a573b4894.tar.xz
tests: move another file (expensive) into test-lib.sh
* 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.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am1
-rwxr-xr-xtests/du/fd-leak5
-rw-r--r--tests/expensive28
-rwxr-xr-xtests/mv/leak-fd8
-rwxr-xr-xtests/rm/hash3
-rwxr-xr-xtests/tail-2/big-4gb2
-rw-r--r--tests/test-lib.sh13
7 files changed, 22 insertions, 38 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7dfafac64..2a16989e1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -12,7 +12,6 @@ EXTRA_DIST = \
README \
check.mk \
envvar-check \
- expensive \
group-names \
input-tty \
lang-default \
diff --git a/tests/du/fd-leak b/tests/du/fd-leak
index c4080ffaf..73fe4f8e7 100755
--- a/tests/du/fd-leak
+++ b/tests/du/fd-leak
@@ -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
index c365f702b..000000000
--- a/tests/expensive
+++ /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
diff --git a/tests/mv/leak-fd b/tests/mv/leak-fd
index 549d25643..1ecdb20c4 100755
--- a/tests/mv/leak-fd
+++ b/tests/mv/leak-fd
@@ -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"
diff --git a/tests/rm/hash b/tests/rm/hash
index 0b2b6c57c..56f96e412 100755
--- a/tests/rm/hash
+++ b/tests/rm/hash
@@ -18,14 +18,13 @@
# 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
diff --git a/tests/tail-2/big-4gb b/tests/tail-2/big-4gb
index b7d25289c..8b64c6ef7 100755
--- a/tests/tail-2/big-4gb
+++ b/tests/tail-2/big-4gb
@@ -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.
diff --git a/tests/test-lib.sh b/tests/test-lib.sh
index 8f56ab105..78ac97dd2 100644
--- a/tests/test-lib.sh
+++ b/tests/test-lib.sh
@@ -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"