From e5956f4d41a220bfecb9622d86479890b442e06c Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sun, 13 Apr 2025 08:34:44 -0400 Subject: [PATCH] add signal handler to run_test script to delete temporary file --- scripts/run_tests.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index bcfc4944..ce07beb3 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -10,6 +10,16 @@ if (( ${#INFILES[@]} == 0 )); then INFILES=(tests/test_*.scad) fi + +cleanup () { + rm -f out.echo + exit +} + +# clean up out.echo if we terminate due to a signal + +trap cleanup SIGINT SIGHUP SIGQUIT SIGABRT + OUTCODE=0 for testfile in "${INFILES[@]}"; do if [[ -f "$testfile" ]] ; then