X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tests%2Ftapdiffer;h=679867ea9d80de619e03451826ade1f26b691907;hb=2582e240bd504307b206a384008adb4dd545eb19;hp=b529a3931fb55fbf9d642b70103883658aef78c6;hpb=d235313e97a52a7f8d94ff4f3b186be71993e3a1;p=open-adventure.git diff --git a/tests/tapdiffer b/tests/tapdiffer index b529a39..679867e 100755 --- a/tests/tapdiffer +++ b/tests/tapdiffer @@ -1,4 +1,6 @@ #! /bin/sh +# SPDX-FileCopyrightText: Copyright Eric S. Raymond +# SPDX-License-Identifier: MIT-0 # # tapdiffer - Render diff between input and checkfile as a TAP report # @@ -8,15 +10,32 @@ # A nonempty diff is shipped as a TAP YAML block following "not ok" # unless QUIET=1 in the environment. # +# This code is intended to be embedded in your project. The author +# grants permission for it to be distributed under the prevailing +# license of your project if you choose, provided that license is +# OSD-compliant; otherwise the following SPDX tag incorporates the +# MIT No Attribution license by reference. +# +# 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 + legend=$1 checkfile=$2 trap 'rm /tmp/tapdiff$$' EXIT HUP INT QUIT TERM -if diff --text -u ${checkfile} - >/tmp/tapdiff$$ +if diff --text "${diffopts}" "${checkfile}" - >/tmp/tapdiff$$ then echo "ok - ${legend}" - exit 0 else echo "not ok - ${checkfile}: ${legend}" if [ ! "${QUIET}" = 1 ] @@ -25,7 +44,6 @@ else sed