26754: tweak zgetdir() and test for realpath()
[zsh.git] / Test / runtests.zsh
blob562234d915e0ead80702cd95781715a67f15dd75
1 #!/bin/zsh -f
3 emulate zsh
5 # Run all specified tests, keeping count of which succeeded.
6 # The reason for this extra layer above the test script is to
7 # protect from catastrophic failure of an individual test.
8 # We could probably do that with subshells instead.
10 integer success failure skipped retval
11 for file in "${(f)ZTST_testlist}"; do
12 $ZTST_exe +Z -f $ZTST_srcdir/ztst.zsh $file
13 retval=$?
14 if (( $retval == 2 )); then
15 (( skipped++ ))
16 elif (( $retval )); then
17 (( failure++ ))
18 else
19 (( success++ ))
21 done
22 print "**************************************
23 $success successful test script${${success:#1}:+s}, \
24 $failure failure${${failure:#1}:+s}, \
25 $skipped skipped
26 **************************************"
27 return $(( failure ? 1 : 0 ))