From ed4daf7429bf2580118aad87b8f3e2011efed7ec Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Thu, 14 Jul 2022 19:09:06 -0400 Subject: Initial commit --- .../shells/zsh/plugins/fzf-tab/test/runtests.zsh | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .config/shells/zsh/plugins/fzf-tab/test/runtests.zsh (limited to '.config/shells/zsh/plugins/fzf-tab/test/runtests.zsh') diff --git a/.config/shells/zsh/plugins/fzf-tab/test/runtests.zsh b/.config/shells/zsh/plugins/fzf-tab/test/runtests.zsh new file mode 100644 index 0000000..18406c0 --- /dev/null +++ b/.config/shells/zsh/plugins/fzf-tab/test/runtests.zsh @@ -0,0 +1,27 @@ +#!/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 ${@:1}; do + zsh +Z -f ./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 )) -- cgit v1.2.3