summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2019-07-01 17:08:43 +0200
committerMark Wielaard <mark@klomp.org>2019-07-01 17:08:43 +0200
commit31c8b3f098b0654db8f573b2a15d5b6d07d4d3b0 (patch)
tree7639c59dffd1b1c71137db6138cf69b50e8c91d0
parenta46200f630b9908085d60883398f1b27aa25bc57 (diff)
downloadelfutils-31c8b3f098b0654db8f573b2a15d5b6d07d4d3b0.tar.gz
tests: Add 2GB to mem_needed running run-large-elf-file.sh with valgrind
Running under valgrind just requires even more free memory. Signed-off-by: Mark Wielaard <mark@klomp.org>
-rw-r--r--tests/ChangeLog5
-rwxr-xr-xtests/run-large-elf-file.sh10
2 files changed, 13 insertions, 2 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 9d15f8fa..400588f4 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2019-07-01 Mark Wielaard <mark@klomp.org>
+
+ * run-large-elf-file.sh: Add 2GB to mem_needed when running under
+ valgrind.
+
2019-06-18 Mark Wielaard <mark@klomp.org>
* Makefile.am (TESTS): Add run-large-elf-file.sh.
diff --git a/tests/run-large-elf-file.sh b/tests/run-large-elf-file.sh
index c244c602..6146cfed 100755
--- a/tests/run-large-elf-file.sh
+++ b/tests/run-large-elf-file.sh
@@ -36,10 +36,16 @@ if test $space_available -lt 10; then
fi
# Make sure the files fit into memory, assume 6GB needed (2.5 * 2 + 1 extra).
+# Running under valgrind might need even more.
+mem_needed=6
+if [ "x$VALGRIND_CMD" != "x" ]; then
+ mem_needed=$[${mem_needed} + 2]
+fi
+echo "mem_needed: $mem_needed"
mem_available=$(free -g | grep ^Mem: | awk -F ' +' '{print $7}')
echo "mem_available: $mem_available"
-if test $mem_available -lt 6; then
- echo "Need at least 6GB free available memory"
+if test $mem_available -lt $mem_needed; then
+ echo "Need at least ${mem_needed}GB free available memory"
exit 77
fi