* 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.
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.
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
# 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
fi
. $srcdir/../test-lib.sh
+very_expensive_
umask 037
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
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'
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'
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'; }
+++ /dev/null
-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