From 4d1f519e1bcca659100a2593bd7ca7f2f4983ffe Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 4 Sep 2026 19:45:05 +0000 Subject: Add a test which runs all the scripts in tests/scripts/good to meaure how many memory allocations they perform, and then rerun them with a mode that causes the memory allocator to fail after N allocations. The scripts are run for all values of N from 0 to the number of allocations they need to succeed. FossilOrigin-Name: ed1953c203d3493d9c1adbcb9256d7d380bc1fdcfc7856f03f9d801291f478cd --- tests/scripts/memfail.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 tests/scripts/memfail.sh (limited to 'tests/scripts/memfail.sh') 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 -- cgit v1.2.3