tests: move the very-expensive file into test-lib.sh
authorJim Meyering <meyering@redhat.com>
Fri, 30 Nov 2007 22:22:21 +0000 (23:22 +0100)
committerJim Meyering <meyering@redhat.com>
Sat, 9 Feb 2008 09:30:33 +0000 (10:30 +0100)
* tests/very-expensive: Remove file.
* tests/test-lib.sh (very_expensive_): New function.
* tests/Makefile.am (EXTRA_DIST): Remove very-expensive.
* tests/cp/perm: Call the new function, rather than sourcing the file.
* tests/tail-2/assert: Likewise.
* tests/tail-2/assert-2: Likewise.
* tests/du/2g: Likewise.

ChangeLog
tests/Makefile.am
tests/cp/perm
tests/du/2g
tests/tail-2/assert
tests/tail-2/assert-2
tests/test-lib.sh
tests/very-expensive [deleted file]

index c0b9743..d00ab45 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
 2007-11-30  Jim Meyering  <meyering@redhat.com>
 
+       Move the very-expensive file into test-lib.sh.
+       * tests/very-expensive: Remove file.
+       * tests/test-lib.sh (very_expensive_): New function.
+       * tests/Makefile.am (EXTRA_DIST): Remove very-expensive.
+       * tests/cp/perm: Call the new function, rather than sourcing the file.
+       * tests/tail-2/assert: Likewise.
+       * tests/tail-2/assert-2: Likewise.
+       * tests/du/2g: Likewise.
+
        Avoid a spurious test failure when build directory is set-GID.
        * tests/cp/fail-perm: Ensure that '.'s set-GID bit is off.
 
index d060c5b..ede6310 100644 (file)
@@ -27,8 +27,7 @@ EXTRA_DIST =          \
   sparse-file          \
   strace               \
   test-lib.sh          \
-  umask-check          \
-  very-expensive
+  umask-check
 
 # Regarding ordering in SUBDIRS, place early in the list the tools that
 # are most commonly used in test scripts.  Every test script uses rm
index 88052aa..a31d430 100755 (executable)
@@ -16,8 +16,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-. $srcdir/../very-expensive
-
 if test "$VERBOSE" = yes; then
   set -x
   cp --version
@@ -25,6 +23,7 @@ if test "$VERBOSE" = yes; then
 fi
 
 . $srcdir/../test-lib.sh
+very_expensive_
 
 umask 037
 
index ea2d6c7..a19b8ab 100755 (executable)
@@ -23,11 +23,11 @@ if test "$VERBOSE" = yes; then
   du --version
 fi
 
-# Creating a 2GB file counts as `very expensive'.
-. $srcdir/../very-expensive
-
 . $srcdir/../test-lib.sh
 
+# Creating a 2GB file counts as `very expensive'.
+very_expensive_
+
 fail=0
 
 # Get number of free kilobytes on current partition, so we can
index 72ee9c9..2ab617e 100755 (executable)
@@ -29,8 +29,8 @@ if test "$VERBOSE" = yes; then
 fi
 
 # Not "expensive" per se, but sleeping for so long is annoying.
-. $srcdir/../very-expensive
 . $srcdir/../test-lib.sh
+very_expensive_
 
 ok='ok ok ok'
 
index 090bf0f..2911878 100755 (executable)
@@ -24,8 +24,8 @@ if test "$VERBOSE" = yes; then
 fi
 
 # Not "expensive" per se, but sleeping for so long is annoying.
-. $srcdir/../very-expensive
 . $srcdir/../test-lib.sh
+very_expensive_
 
 ok='ok ok ok'
 
index cfc386a..3b8d2ce 100644 (file)
@@ -87,6 +87,19 @@ require_selinux_()
   esac
 }
 
+very_expensive_()
+{
+  if test "$RUN_VERY_EXPENSIVE_TESTS" != yes; then
+    skip_test_ '
+This test is very expensive, so it is disabled by default.
+To run it anyway, rerun make check with the RUN_VERY_EXPENSIVE_TESTS
+environment variable set to yes.  E.g.,
+
+  env RUN_VERY_EXPENSIVE_TESTS=yes make check
+'
+  fi
+}
+
 skip_if_root_() { uid_is_privileged_ && skip_test_ "must be run as non-root"; }
 error_() { echo "$0: $@" 1>&2; (exit 1); exit 1; }
 framework_failure() { error_ 'failure in testing framework'; }
diff --git a/tests/very-expensive b/tests/very-expensive
deleted file mode 100644 (file)
index 3e27c0b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-if test "$RUN_VERY_EXPENSIVE_TESTS" != yes; then
-  cat <<EOF >&2
-$0: This test is very expensive, so it is disabled by default.
-To run it anyway, rerun make check with the RUN_VERY_EXPENSIVE_TESTS
-environment variable set to yes.  E.g.,
-
-  env RUN_VERY_EXPENSIVE_TESTS=yes make check
-
-EOF
-  (exit 77); exit 77
-fi