sbase/tests/runtests.sh
Roberto E. Vargas Caballero 59f7e45270 tests: Use exit in signal traps
It avoids duplicating the cleaning actions and keep the correct exit
status.
2026-01-05 22:29:57 +01:00

17 lines
301 B
Bash
Executable File

#!/bin/sh
export TZ=UTC
trap 'rm -f test.res' EXIT HUP INT TERM
trap 'exit $?' HUP INT TERM
for i in *-*.sh
do
printf "Test: %s\n\n" $i >> test.log
(./$i >> test.log 2>&1 && printf '[PASS]\t' || printf '[FAIL]\t'
echo "$i") | tee -a test.log
done |
tee test.res
! grep FAIL test.res >/dev/null