diff options
author | Jim Meyering <meyering@redhat.com> | 2012-08-02 19:12:18 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2012-08-04 12:03:06 +0200 |
commit | 4bee223d96fe34fd5290575ddb6eba7c9c7d7418 (patch) | |
tree | 3290be5bd1e6f0a306636f3f1c5b13ef4cf118ba | |
parent | 4abec7ef9a3e162098b6b4c1e19a8235023130d4 (diff) | |
download | coreutils-4bee223d96fe34fd5290575ddb6eba7c9c7d7418.tar.xz |
tests: avoid FP ulimit failure with valgrind-wrapped tools
* tests/init.cfg (require_ulimit_): Raise VM limit from 10MiB to
20MiB, to accommodate overhead of a valgrind-wrapped date program.
Also declare this function's local variables "local".
-rw-r--r-- | tests/init.cfg | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/init.cfg b/tests/init.cfg index c1cb92fb2..506c9b329 100644 --- a/tests/init.cfg +++ b/tests/init.cfg @@ -107,14 +107,19 @@ require_openat_support_() require_ulimit_() { - ulimit_works=yes - # Expect to be able to exec a program in 10MB of virtual memory, - # but not in 20KB. I chose "date". It must not be a shell built-in + local ulimit_works=yes + # Expect to be able to exec a program in 10MiB of virtual memory, + # (10MiB is usually plenty, but valgrind-wrapped date requires 19000KiB, + # so allow more in that case) + # but not in 20KiB. I chose "date". It must not be a shell built-in # function, so you can't use echo, printf, true, etc. # Of course, in coreutils, I could use $top_builddir/src/true, # but this should be able to work for other projects, too. - ( ulimit -v 10000; date ) > /dev/null 2>&1 || ulimit_works=no - ( ulimit -v 20; date ) > /dev/null 2>&1 && ulimit_works=no + local vm + case $(printenv LD_PRELOAD) in */valgrind/*) vm=22000;; *) vm=10000;; esac + + ( ulimit -v $vm; date ) > /dev/null 2>&1 || ulimit_works=no + ( ulimit -v 20; date ) > /dev/null 2>&1 && ulimit_works=no test $ulimit_works = no \ && skip_ "this shell lacks ulimit support" |