X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=blobdiff_plain;f=tests%2Ftapdiffer;fp=tests%2Ftapdiffer;h=ea1cfa7041f5ca004f8edb737ea2c533da6b200d;hp=679867ea9d80de619e03451826ade1f26b691907;hb=3c09c25cc3343546143447547297d23201f2140c;hpb=f26514b5dd3624076f59801cfca66cc7cbdd3313 diff --git a/tests/tapdiffer b/tests/tapdiffer index 679867e..ea1cfa7 100755 --- a/tests/tapdiffer +++ b/tests/tapdiffer @@ -1,6 +1,4 @@ #! /bin/sh -# SPDX-FileCopyrightText: Copyright Eric S. Raymond -# SPDX-License-Identifier: MIT-0 # # tapdiffer - Render diff between input and checkfile as a TAP report # @@ -16,17 +14,23 @@ # OSD-compliant; otherwise the following SPDX tag incorporates the # MIT No Attribution license by reference. # +# SPDX-FileCopyrightText: (C) Eric S. Raymond +# SPDX-License-Identifier: MIT-0 +# # A newer version may be available at https://gitlab.com/esr/tapview # Check your last commit dqte for this file against the commit list # there to see if it might be a good idea to update. # -if [ "$1" = "-b" ] -then - diffopts=-ub - shift -else - diffopts=-u -fi +diffopts=-u +while getopts bn opt +do + case $opt in + b) diffopts=-ub;; + *) echo "tapdiffer: unknown option ${opt}."; exit 1;; + esac +done +# shellcheck disable=SC2004 +shift $(($OPTIND - 1)) legend=$1 checkfile=$2 @@ -37,7 +41,7 @@ if diff --text "${diffopts}" "${checkfile}" - >/tmp/tapdiff$$ then echo "ok - ${legend}" else - echo "not ok - ${checkfile}: ${legend}" + echo "not ok - ${legend}" if [ ! "${QUIET}" = 1 ] then echo " --- |"