From: Jim Meyering Date: Thu, 24 Apr 2008 10:50:24 +0000 (+0200) Subject: tests: move another file (expensive) into test-lib.sh X-Git-Tag: v6.12~91 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=427f179542e9f7228f77affdd5a4c50a573b4894;p=platform%2Fupstream%2Fcoreutils.git 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. --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 7dfafac..2a16989 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 c4080ff..73fe4f8 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 c365f70..0000000 --- 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 . - -if test "$RUN_EXPENSIVE_TESTS" != yes; then - cat <&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 549d256..1ecdb20 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 0b2b6c5..56f96e4 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 . -. $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 b7d2528..8b64c6e 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 8f56ab1..78ac97d 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"