summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/scripts/memfail.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/scripts/memfail.sh b/tests/scripts/memfail.sh
new file mode 100755
index 0000000..3909ab8
--- /dev/null
+++ b/tests/scripts/memfail.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+set -e
+
+export APLWC_ALLOC_FAIL_AFTER=-1
+N=$($1 3>&1 1>/dev/null 2>/dev/null)
+
+for n in $(seq 0 $N)
+do
+ echo $n out of $N
+ export APLWC_ALLOC_FAIL_AFTER=$n
+ $1 1>/dev/null 2>/dev/null
+done