&& { echo '$(ME): do not use EXIT_FAILURE in the above' \
1>&2; exit 1; } || :
+# Ensure that tests call the require_ulimit_v_ function if using ulimit -v
+sc_prohibit_test_ulimit_without_require_:
+ @(git grep -l require_ulimit_v_ tests; \
+ git grep -l 'ulimit -v' tests) \
+ | sort | uniq -u | grep . && { echo "$(ME): the above test(s)"\
+ " should match require_ulimit_v_ with ulimit -v" 1>&2; exit 1; } || :
+
# Ensure that tests call the print_ver_ function for programs which are
# actually used in that test.
sc_prohibit_test_calls_print_ver_with_irrelevant_argument:
fi
}
-require_ulimit_()
+require_ulimit_v_()
{
local ulimit_works=yes
# Expect to be able to exec a program in 10MiB of virtual memory,
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ cp
expensive_
-require_ulimit_
+require_ulimit_v_
a=$(printf %031d 0)
b=$(printf %031d 1)
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ dd
-require_ulimit_
+require_ulimit_v_
# count and skip is zero, we don't need to allocate memory
(ulimit -v 20000; dd bs=30M count=0) || fail=1
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ csplit
-require_ulimit_
+require_ulimit_v_
(
ulimit -v 20000
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ cut
-require_ulimit_
+require_ulimit_v_
getlimits_
# From coreutils-8.10 through 8.20, this would make cut try to allocate
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ head
+require_ulimit_v_
# exercise the fix of 2001-08-18, based on test case from Ian Bruce
echo abc > in || framework_failure_
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ printf
-
-require_ulimit_
+require_ulimit_v_
# Up to coreutils-6.9, "printf %.Nf 0" would encounter an ENOMEM internal
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ sort
-require_ulimit_
mkdir in err || framework_failure_
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ rm du chmod
+require_ulimit_v_
expensive_
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ split
-require_ulimit_
-
# N can be greater than the file size
# in which case no data is extracted, or empty files are written
split -n r/10 /dev/null || fail=1