]> pd.if.org Git - zpackage/commitdiff
add required test to tap
authorNathan Wagner <nw@hydaspes.if.org>
Sat, 4 Mar 2017 17:36:06 +0000 (11:36 -0600)
committerNathan Wagner <nw@hydaspes.if.org>
Sun, 5 Mar 2017 15:05:15 +0000 (09:05 -0600)
t/tap.sh

index 553128ffe01e9a55e5e58570acc07699f1dab1ea..59df961a207547397e0719816096d61fe67f6de8 100755 (executable)
--- a/t/tap.sh
+++ b/t/tap.sh
@@ -15,6 +15,20 @@ tryrun() {
        printf 'ok %d - %s %s\n' $tn $program "$*"
 }
 
+require() {
+       note="$@"
+       program=$1
+       shift
+       $program "$@"
+       if [ $? -ne 0 ]; then
+               printf "bail out! fail[$?]: $@\n"
+               exit 255;
+       fi
+       tn=$((tn + 1))
+       printf 'ok %d - %s %s\n' $tn $program "$*"
+
+}
+
 shownote() {
        if [ "$note" != "" ]; then
                printf '# %s\n' "$note"