Allow passing an argument to the crash hunt script

This commit is contained in:
Veronica Berglyd Olsen
2026-08-01 12:58:21 +02:00
parent fee724f2d9
commit 4a20de77f9

View File

@@ -1,9 +1,11 @@
#!/bin/bash
# A debug script that will run the test suite repeatedly, looking for
# crashes. Takes the number of attempts as $1 (default 10).
# crashes. Takes the number of attempts as $1 (default 10). Any further
# arguments are forwarded to pytest, e.g. --run-long.
COUNT=${1:-10}
shift || true
mkdir -p ./debug
LOGDIR=./debug
@@ -15,7 +17,7 @@ while [ $i -lt "$COUNT" ]; do
-ex "handle SIGSEGV stop nopass" \
-ex "handle SIGABRT stop nopass" \
-ex run -ex "bt full" -ex quit \
--args .venv/bin/python -m pytest tests -q \
--args .venv/bin/python -m pytest tests -q "$@" \
> "$LOGDIR/crash_hunt_run_$i.log" 2>&1
if grep -qE "SIGSEGV|SIGABRT|Segmentation fault" "$LOGDIR/crash_hunt_run_$i.log"; then
echo ">>> CRASH on attempt $i — see $LOGDIR/crash_hunt_run_$i.log <<<"