2007-12-18 22:16:30 +01:00
|
|
|
#!/bin/zsh -f
|
|
|
|
|
|
|
|
emulate zsh
|
|
|
|
|
|
|
|
# Run all specified tests, keeping count of which succeeded.
|
|
|
|
# The reason for this extra layer above the test script is to
|
|
|
|
# protect from catastrophic failure of an individual test.
|
|
|
|
# We could probably do that with subshells instead.
|
|
|
|
|
2021-04-18 22:58:09 +02:00
|
|
|
integer success=0 failure=0 skipped=0 retval
|
2007-12-18 22:16:30 +01:00
|
|
|
for file in "${(f)ZTST_testlist}"; do
|
|
|
|
$ZTST_exe +Z -f $ZTST_srcdir/ztst.zsh $file
|
2007-12-25 02:40:16 +01:00
|
|
|
retval=$?
|
|
|
|
if (( $retval == 2 )); then
|
|
|
|
(( skipped++ ))
|
|
|
|
elif (( $retval )); then
|
2007-12-18 22:16:30 +01:00
|
|
|
(( failure++ ))
|
2024-03-03 05:26:01 +01:00
|
|
|
(( $retval > 128 )) && print "$file: failed: SIG$signals[$retval - 127]."
|
2007-12-18 22:16:30 +01:00
|
|
|
else
|
|
|
|
(( success++ ))
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
print "**************************************
|
|
|
|
$success successful test script${${success:#1}:+s}, \
|
2007-12-25 02:40:16 +01:00
|
|
|
$failure failure${${failure:#1}:+s}, \
|
|
|
|
$skipped skipped
|
2007-12-18 22:16:30 +01:00
|
|
|
**************************************"
|
|
|
|
return $(( failure ? 1 : 0 ))
|