about summary refs log tree commit diff
path: root/Test/runtests.zsh
diff options
context:
space:
mode:
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 ))