about summary refs log tree commit diff
path: root/Test/runtests.zsh
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-12-18 21:16:30 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-12-18 21:16:30 +0000
commitf8585a7c21f6ac2692a608bc60ffc715489616c3 (patch)
tree50a982574344bc390e789777862b5f538522078c /Test/runtests.zsh
parent1ee6295909c893c55693232a12f10cd8625a7260 (diff)
downloadzsh-f8585a7c21f6ac2692a608bc60ffc715489616c3.tar.gz
zsh-f8585a7c21f6ac2692a608bc60ffc715489616c3.tar.xz
zsh-f8585a7c21f6ac2692a608bc60ffc715489616c3.zip
24289 plus Ismail's suggestion 24290: count test scripts succeeded and failed
Diffstat (limited to 'Test/runtests.zsh')
-rw-r--r--Test/runtests.zsh23
1 files changed, 23 insertions, 0 deletions
diff --git a/Test/runtests.zsh b/Test/runtests.zsh
new file mode 100644
index 000000000..1d4321576
--- /dev/null
+++ b/Test/runtests.zsh
@@ -0,0 +1,23 @@
+#!/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
+for file in "${(f)ZTST_testlist}"; do
+  $ZTST_exe +Z -f $ZTST_srcdir/ztst.zsh $file
+  if (( $? )); then
+    (( failure++ ))
+  else
+    (( success++ ))
+  fi
+done
+print "**************************************
+$success successful test script${${success:#1}:+s}, \
+$failure failure${${failure:#1}:+s}
+**************************************"
+return $(( failure ? 1 : 0 ))