1
0
Fork 0
mirror of https://github.com/zdharma-continuum/zinit-module.git synced 2024-11-21 13:27:58 +01:00
zinit-module/Test/runtests.zsh
Philipp Schmitt e3af3f8ae8
🧹 Clean up! (#1)
2021-11-19 10:14:34 +01:00

27 lines
758 B
Bash

#!/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.
integer success failure skipped retval
for file in "${(f)ZTST_testlist}"; do
$ZTST_exe +Z -f $ZTST_srcdir/ztst.zsh $file
retval=$?
if (( $retval == 2 )); then
(( skipped++ ))
elif (( $retval )); then
(( failure++ ))
else
(( success++ ))
fi
done
print "**************************************
$success successful test script${${success:#1}:+s}, \
$failure failure${${failure:#1}:+s}, \
$skipped skipped
**************************************"
return $(( failure ? 1 : 0 ))